APIs & Integrations

nickmarshallmpg
Participant

Get month over month email statistics

Hi,

 

I am working on creating a marketing overview dashboard for my company.  We would like to see month over month email statistics.  Currently the only way to get that data is to manually export the emails on the "Marketing->Email" tab and select each month in the fixed time frame.  I am looking for an api that will allow me to get the same data that is available via that report but in an automated fashion.  


I wrote a script that warehoused every single email event in our hubspot instance (api endpoint: email/public/v1/events) which will work but the number of records is too big for my MySql database.  Any recommendations here would be great! I would think month over month email metrics would be a common request. 

 

Thank you,


Nick

6 Replies 6
Sam_Williams
Member

Get month over month email statistics

Hello @nickmarshallmpg 

 

We had similar issues across our organisation as well. And since we are a lead generation and marketing agency, tracking the emails sent were very important to us. 

 

Luckily we came across one tool which integrateed with HS and allowed us to get deeper insights on our campaigns. 

 

If you or anyone would like to know about the tool I can send an inbox.

 

 

 

 

0 Upvotes
lscanlan
HubSpot Alumni
HubSpot Alumni

Get month over month email statistics

Hi @nickmarshallmpg,

 

I think you should be able to do this using our Marketing Email API, which you can find documentation for here: https://developers.hubspot.com/docs/methods/lists/marketing-email-overview. You can filter the request in the request URL. So if you wanted to pull emails sent within a certain time range, you could use the endpoint documented here: https://developers.hubspot.com/docs/methods/cms_email/get-all-marketing-emails. Your request could look something like: marketing-emails/v1/emails?hapikey=XXXX&publish_date__gte=1556668800000&publish_date__lt=1559347200000 . And then using the IDs returned in the response, you can get the stats for an individual email through the endpoint documented here: https://developers.hubspot.com/docs/methods/cms_email/get-the-statistics-for-a-marketing-email. So far as I can tell, everything that's included in the report from the Email dashboard can also be found through these Marketing Email endpoints.

 

Let me know if that will help accomplish what you're looking for or if you have any questions here.

Leland Scanlan

HubSpot Developer Support
0 Upvotes
PowerMyAnalytic
Top Contributor

Get month over month email statistics

Hi @lscanlan,

 

I think that he ask about aggregation, so I'm join in 🙂

 

I want to get marketing email statistics grouped by day.

(you have this option in Analytics API)

As I understand from the documentation https://developers.hubspot.com/docs/methods/cms_email/get-all-marketing-email-statistics

the endpiont retrieves only lifetime stats.

 

But in the Marketing dashboard I can choose from multiple date range options - so the daily data is somewere...

2019-09-24 15_23_32-Reports dashboard.png

Can you guid me how to retrieve daily statistics?

 

nickmarshallmpg
Participant

Get month over month email statistics

What I ended up doing was grabbing all email events.  Here's the url: 

http://api.hubapi.com/email/public/v1/events

 

This will retrieve every single event which means that you will need a very big database to store it (make sure to index).  These event come with date stamps so I am using that field with Tableau to make month charts for email activity.  Let me know if  you have questions on how to break this out. Not ideal as an endpoint that had the aggregated monthly values would be much more efficient but it is working for now. 

 

PowerMyAnalytic
Top Contributor

Get month over month email statistics

Thanks. 

That what we do now...

 

But I hope that HubSpot will provied simple solution 

johnelmer
Top Contributor | Elite Partner
Top Contributor | Elite Partner

Get month over month email statistics

There is now a HubSpot to Tableau connector in the HubSpot App marketplace. The connector service includes a HubSpot-optimized SQL data warehouse hosted in the Microsoft Azure cloud. 

Did this post help solve your problem? If so, please mark it as a solution.






John Elmer, CEO
Bayard Bradford

Advanced CRM Implementation | HubSpot Custom Integration Services | Datawarehouse.io Apps for HubSpot
Elite HubSpot Solutions Partner
> Follow me on LinkedIn