<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1822615684631785&amp;ev=PageView&amp;noscript=1"/>

How to Pull Campaign Reporting Data Using the GMass API

Need to pull your GMass campaign reporting data into another app or a dashboard?

Good news: It’s a simple, straightforward process when you use the GMass API.

In this guide I’ll build on the GMass API docs and walk you through pulling full aggregated campaign reports or detailed individual metrics using GMass API.

Pulling Campaign Reporting Data with the GMass API: Table of Contents

Step 0: Getting Your API Key and Authenticating Into the API

As with any process involving the GMass API, the first step is generating or retrieving an API key.

Generating or retrieving your GMass API key

You can create a new key or grab an existing one from the GMass dashboard.

Click the Settings icon in the top right, then open the API Keys section and click Manage API Keys.

The API keys section of the dashboard

Click on the Create a new API Key button if you don’t already have a key (or want to make a new one for this).

Creating a new GMass API key

Now click the clipboard icon to copy the key. You can always come back to the dashboard to retrieve this key in the future.

Copying your API key to the clipboard

Authenticating with your API key

Now that you have your key handy, you have two ways you can use it to authenticate into the GMass API.

You can include it in a query string after you call any GMass API endpoint.

The endpoints all start https://api.gmass.co/api/. So if you were retrieving the opens for a campaign, you would do https://api.gmass.co/api/reports/342342332/opens?apikey=f629a324-e31s-34234-23423. (The 342342332 is whatever your campaign ID is.)

The other option for authenticating into the API is passing your key via a HTTP header, using X-apikey.

For the demos in this article, I’m using the Swagger testing site for the GMass API. You can use that site as well by pasting your API key into the top bar on that page.

Option 1: Pulling All Aggregated Reporting Data for All Campaigns

First up, I’ll cover what to do if you want to get all of your reporting data for all of your campaigns.

For that, we’ll use the /api/campaigns endpoint. That will list all of your campaigns and their aggregated reporting data. (In other words: You’ll just see the numbers of things like opens, clicks, and replies — not more granular detail like who opened or what link they clicked on.)

You don’t need to use any parameters here (limit and offset are optional, though, if you don’t want all your campaigns).

Getting all reporting data for all campaigns with the GMass API

If you have a large number of campaigns, this reponse can take some time.

You can use the optional parameters to cut down on that time:

  • Limit will, of course, limit the number of campaigns GMass pulls to the n most recent.
  • Offset starts from further back (for instance, an offset of 5 would start pulling at the 6th most recent campaign).

Option 2: Pulling All Aggregated Reporting Data for a Single Campaign

Now let’s say you only want to pull all the aggregated reporting data for a single campaign.

While you could do that with the /api/campaigns endpoint using offset and limit, it’s cleaner and often easier to use this technique.

Here, we’ll expand on the /api/campaigns method and make it /api/campaigns/yourcampaignID.

So, for example, let’s say we wanted to pull the reporting data for campaign 43120372.

(You can find campaign IDs in a wide variety of places, including the email GMass sends you for your campaign and the GMass dashboard. They’re also available via the API using the /api/campaigns method — though that does feel somewhat circuitous since we’re using this other process to avoid listing out all our campaigns and stats).

The result:

There are no optional parameters here; it’s a straightforward pull of the reporting data (plus other campaign info like the email list, Google Sheet source, and auto follow-ups) for your single campaign.

Option 3: Pulling Detailed Data for a Specific Metric for a Single Campaign

Finally, rather than aggregated data, we’ll pull detailed data on one metric from one campaign.

Here, we’ll use the /api/reports endpoint, where you can retrieve the following:

  • /api/reports/yourcampaignID/recipients – list all recipients of the campaign, including what time the email to each recipient went out and, if you’re using MultiSend inbox rotation, which sending account sent them the message.
  • /api/reports/yourcampaignID/opens – open data for the campaign if you had open tracking turned on, including the open count and last open time.
  • /api/reports/yourcampaignID/clicks – click data for the campaign if you had click tracking turned on, including the link they clicked on and the time they clicked.
  • /api/reports/yourcampaignID/unsubscribes – unsubscribes for the campaign, including the time they unsubscribed.
  • /api/reports/yourcampaignID/bounces – bounces for the campaign
  • /api/reports/yourcampaignID/blocks – blocks for the campaign
  • /api/reports/yourcampaignID/replies – reply data for the campaign, including what time they replied and the MultiSend sender.

Here’s an example of what the API returns for /recipients:

Getting recipients data for a single campaign

And here’s an example of /replies. GMass will return everyone who replied (so in my case here, there were two replies to the campaign and they’re both listed):

Getting reply data for a single campaign

There are some optional parameters here as well.

For the /recipients endpoint, you can specify a limit, offset, stage (if you want to see data for an auto follow-up stage), or date.

For the other endpoints, you can specify a limit and offset.

Ready to Retrieve Your Reports Using the GMass API?

That’s all you’ll need to do to retrieve reports from all or one of your campaigns using the GMass API.

  • To get all aggregated reports from all campaigns, use the /api/campaigns endpoint.
  • To get full aggregated reporting from a single campaign, append the campaign ID there and use /api/campaigns/yourcampaignID
  • And to get detailed data from a single metric from a single campaign, use the /api/reports/yourcampaignID/opens (et. al.) endpoint.

If you’re ready to start using the GMass API to send campaigns, send transactional emails, get reports, and do a whole lot more, good news.

The API is included in GMass’s Premium, Professional, and Team plans. You can check those out on the GMass pricing page.

And with all of those plans you can also use GMass inside of Gmail, sending campaigns just like you send normal emails.

Join the 300,000+ others who use and love GMass (we have a 4.8/5 star rating after 10,000+ reviews).

Send unlimited emails, see why 99% of people report the best deliverability they’ve ever had, and a ton more.

GMass is free to try, with no credit card required. You can get started by downloading the GMass Chrome extension and you’ll be up and running in minutes.

Ready to transform Gmail into an email marketing/cold email/mail merge tool?


Only GMass packs every email app into one tool — and brings it all into Gmail for you. Better emails. Tons of power. Easy to use.


TRY GMASS FOR FREE

Download Chrome extension - 30 second install!
No credit card required
Love what you're reading? Get the latest email strategy and tips & stay in touch.
   


Leave a Reply

Your email address will not be published. Required fields are marked *

Send your first campaign in a matter of minutes

No credit card required

Try GMass for free Then check out the quickstart guide to send your first mail merge email in minutes!

GMass

Share This