Import ActiveCampaign Data to Google Sheets

Import ActiveCampaign Data to Google Sheets

Last Updated On September 25, 2019

ActiveCampaign is an email marketing and CRM platform for small businesses. In this guide, we’ll walk through how to pull data from the ActiveCampaign API directly into Google Sheets, using the free API Connector add-on. We’ll first get an API key from ActiveCampaign, and then set up a request to pull in email campaign data from ActiveCampaign to your spreadsheet.

PART 1: GET YOUR ACTIVECAMPAIGN API KEY

  1. Log in to ActiveCampaign and click “Settings” in the left side navigation menu.
    api-connector-activecampaign-img1
  2. The Account Settings menu will appear. Click “Developer”.
    api-connector-activecampaign-img2
  3. You should now see a page containing your API URL and Key. Congrats! You’re now ready to use the ActiveCampaign API.
    api-connector-activecampaign-img3

PART 2: CREATE YOUR API REQUEST URL

We’re going to follow the ActiveCampaign API documentation to view your contact list.

  • Base URL: https://<your-account>.api-us1.com/api/3/
    Base URL example: https://testakravitz.api-us1.com/api/3
  • Endpoint: /contacts

Putting it all together, we get the full API Request URL:
https://testakravitz.api-us1.com/api/3/contacts

Of course, you’ll need to substitute in your own account ID.

PART 3: ENTER VALUES INTO API CONNECTOR

We can now enter all our values into API Connector and start importing ActiveCampaign data into Google Sheets.

  1. Open up Google Sheets and click Add-ons > API Connector > Create New API Request.
  2. In the Create Request interface, enter the Request URL we just created
    api-connector-activecampaign-img4
  3. Under Headers, enter a key-value pair like this:
    Api-Token {API Key}

    Replace {Api Key} with the value provided above in step 3.
    api-connector-activecampaign-img5

  4. Create a new tab. You can call it whatever you like, but here we’ll call it ‘AC_contacts’. While still in that tab, click ‘Set’ to use that tab as your data destination.
  5. Click the ‘Output options’ button and choose the ‘compact’ style for your report (more info on report styles here.)
    api-connector-activecampaign-img6
  6. Name your request. Again we’ll call it ‘AC_contacts.’
  7. Click Run and a moment later you’ll see ActiveCampaign data populate the AC_contacts tab in your Google Sheet:
    api-connector-activecampaign-img7

  8. If your contacts utilize custom fields, these custom field values can be retrieved using the /fieldValues endpoint. As the fieldValues endpoint will only produce their ID, you can also use the /fields endpoint to get their name. Once you have all the values in Sheets, you can merge them together as desired using queries and other functions native to Sheets.

PART 4: NOTES AND EXPANSIONS

  1. Change the endpoints as described in the documentation to retrieve different data. For example, changing it from /contacts to /campaigns will produce a list of all your ActiveCampaign campaigns.
  2. Note Active Campaign’s limits on the number of records returned on a response. By default, only 20 records will be returned unless you use the ‘limit’ and ‘offset’ parameters as described in their documentation. api-connector-activecampaign-img8
    To get 100 records, you’d use the ‘limit’ parameter and to return more than 100 you’d then make a second request using the ‘offset’ parameter. For example:
    page 1: https://site.api-us1.com/api/3/campaigns?limit=100
    page 2: https://site.api-us1.com/api/3/campaigns?limit=100&offset=100
  3. With API Connector you can either set these up as separate requests or run them together (paid feature) for added efficiency.

Comments:0

Leave a Reply

Your email address will not be published.