Search API Connector Documentation

Print

Import Snapchat Ad Data to Google Sheets

In this guide, we’ll walk through how to import Snapchat Ads data directly into Google Sheets, using the API Connector add-on for Sheets.

Contents

Before You Begin

Click here to install the API Connector add-on from the Google Marketplace.

Part 1: Get your Snapchat OAuth Credentials

  1. Log in to Ads Manager.
  2. Click the Manage Ads menu in the top corner and select Business Details.
    snapchat-businessdetails
  3. Scroll down and click +OAuth App
    snapchat-newoauth
  4. Agree to the terms and conditions.
  5. You'll be asked to give your app a name and a redirect URL. You can name your app anything, but make sure to use the redirect URL provided in this article.
    snapchat-createapp
  6. Click through and you'll be presented with your Client ID and Secret. Copy these down, we'll need them shortly.
    snapchat-credentials

Part 2: Connect Snapchat to API Connector

  1. Open up Google Sheets and click Extensions > API Connector > Manage Connections
  2. Scroll to the bottom of the sidebar and click Add Custom OAuth
  3. Fill in the Custom OAuth modal like this:
    1. Name: Custom Snapchat
    2. Authorization Base URL: https://accounts.snapchat.com/login/oauth2/authorize?scope=snapchat-marketing-api
    3. Token URL: https://accounts.snapchat.com/login/oauth2/access_token
    4. Client IDprovided by Snapchat
    5. Client Secretprovided by Snapchat
  4. Click Save
    snapchat-custom
  5. Click Manage Connections to return to the list of connections
  6. Scroll down until you find your new custom connection. Click Connect
    snapchat-connect
  7. You'll be prompted to give access to the new app you created above. Click Continue.
    snapchat-connectoauth
  8. You'll be returned to your sheet and can verify that the new connection is now active.

Part 3: Get Snapchat Ad Data in Sheets

To create a request, include your full request URL in the request URL field, and select your custom Snapchat connection from the dropdown OAuth menu.

You can see the full list of available request URLs in the API documentation. For example, to get your organization ID, run a request to https://adsapi.snapchat.com/v1/me/organizations

Pay attention to your organization ID as you'll need that for subsequent requests, e.g. get your ad account IDs by plugging it into https://adsapi.snapchat.com/v1/organizations/your_org_id/adaccounts

Part 4: API Documentation

Official API documentation: https://marketingapi.snapchat.com/docs/

The documentation provides all the URLs that you can plug into API Connector's request URL field, for example here's their listing of the /adaccounts URL from the above example.

8 thoughts on “Import Snapchat Ad Data to Google Sheets”

  1. Hi Ana, thanks for the prompt action. Really appreciate it. Can you also guide us in pulling spends, clicks, campaign names the same way you did in your fb and google guides? I think they are called endpoints as well. Thanks in advance.

    Reply
    • Sorry to abuse my requests. Just requesting for another one so I can get the reply in one go. With my above request can you also check if we can extract spends, clicks, campaign names, impressions, cpc, etc and using a custom date range so i can use your importapi function with it. The same way I did with google. So sorry for the trouble.

      Reply
      • Unfortunately I don't have an ads account so I can't test anything but you can click on the relevant endpoints in the documentation's /measurement section and try out their example URLs. Here's their example of how to get data by campaign, I've just slightly modified it and removed a few of the fields you aren't interested in: https://adsapi.snapchat.com/v1/campaigns/2bbaa6e3-4ddb-4358-9efe-48334952f4aa/stats?breakdown=ad&fields=frequency,impressions,spend,swipes,view_completion,video_views&granularity=DAY&start_time=2022-10-24T07:00:00.000-00:00&end_time=2022-10-26T07:00:00.000-00:00 It looks like they only send back data for one campaign at a time so you need to run a separate request for each campaign ID. One approach would be to construct your full set of URLs in your sheet, one for each campaign ID, then cycle through the whole list with a cell reference like +++Sheet1!A1:A10+++
        By the way, you don't need IMPORTAPI to use a custom date range, you can do that in the sidebar (this article has an example).

  2. Thank you so much ana for the clarification. So snapchat doesn't have an endpoint to get all the campaign spends per ad account? It always need to be in the campaign level?

    Reply
    • Hey Lixx, I don't see an endpoint for campaign data per ad account, do you? You can use the multi-query method to loop through all the campaign IDs at once, so setup should be pretty easy, but if that seems complicated or you aren't comfortable working with APIs directly you may want to try out a data warehouse tool like the one you linked. API Connector is a direct pipe from APIs to Google Sheets -- we don't have any backend database, so our system doesn't pre-process the data. All Snapchat integrations use the same endpoints provided by Snapchat, but some tools may first loop through all the campaign IDs and store data in their data warehouse, while we directly connect the API to Sheets without going through a data warehouse. So the retrieval methods are a bit different on the user side.

      Reply
      • Alright thanks for the info Ana. Still very helpful as usual. Unfortunately we cannot specify each campaign ID as we launch tons of campaigns everyday. It will be very tedious to keep adding campaign IDs explicitly.

        This guide is new so I'll be sure to follow this from time to time. Maybe some day there'll be some developments from you. Thanks again Ana, appreciate your promptness to help.

      • I think you can still do this fairly automatically, like first use https://adsapi.snapchat.com/v1/adaccounts/{ad_account_id}/campaigns to fetch a list of campaigns, and then run a request like https://adsapi.snapchat.com/v1/campaigns/+++Sheet1!A1:A50+++/stats?fields=frequency,impressions,spend,swipes,view_completion,video_views to cycle through that list of campaigns. I'll update this article if I get access to a Snapchat ads account and learn other methods of interacting with their API.

Leave a Comment

Jump To...