APIs & Integrations

Elsssss
Participant

timeline activity for marketing emails

SOLVE

We would like to send some data from Hubspot (starter package) to a custom made CRM. Does anyone know a workaroun to optain these data?

 

It is about: We would like to get contacts with their timeline activity for marketing emails (send date, delivery status, open/click etc), with each email in a separate row, contained per contactperson.

0 Upvotes
2 Accepted solutions
Willson
Solution
HubSpot Employee
HubSpot Employee

timeline activity for marketing emails

SOLVE

Hi @Elsssss,

 

This is possible through the use of our Email Analytics endpoint, specifically the Get email events API found here.

 

As per the documentation, you'll see that this endpoint is used to query the event log for events; which are defined here, matching specified parameters.

 

An example of this would be the following request:

Request: 
GET https://api.hubapi.com/email/public/v1/events?hapikey=demo&campaignId=13054799&limit=1&offset=Ch8KFgjC0cOq15yCtakBEOXx7NT479WQkgEYiNiW5uUo

Response:
{
    "events": [
        {
            "appId": 20185,
            "appName": "AbBatch",
            "browser": {
                "family": "Google Image Cache",
                "name": "Google Image Cache",
                "producer": "",
                "producerUrl": "",
                "type": "Proxy",
                "url": "",
                "version": []
            },
            "created": 1401715797602,
            "emailCampaignId": 13054799,
            "hmid": "ELPoAxjZnQEoz+acBjoSbWF4aWFrQGh1YnNwb3QuY29t",
            "id": "fb5f4051-0bf9-3b3c-92f4-ffbab071ed66",
            "location": {
                "city": "Unknown",
                "country": "Unknown",
                "state": "Unknown"
            },
            "portalId": 62515,
            "recipient": "maxiak@hubspot.com",
            "type": "OPEN",
            "userAgent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7 (via ggpht.com GoogleImageProxy)"
        },
        {
            "appId": 20185,
            "appName": "AbBatch",
            "browser": null,
            "created": 1401715797000,
            "emailCampaignId": 13054799,
            "hmid": "CiQ4ZWE5NTlmYy00MmU1LTRlZDctOTJjZC0zNjI0ZGRlNGYwODQQs+gDGNmdASAAKM/mnAYwoRY6Em1heGlha0BodWJzcG90LmNvbUCUhZPm5ShIAVooMWQ5NmYyODcyNDFjMmQzYWU1MDEwNTc3NmRkMDI5NzQ4ZjVjY2U3NXCR9A0=",
            "id": "9221577f-8a9b-38e5-a96a-08e57550e8c2",
            "location": null,
            "portalId": 62515,
            "recipient": "maxiak@hubspot.com",
            "sentBy": {
                "created": 1401715737236,
                "id": "8ea959fc-42e5-4ed7-92cd-3624dde4f084"
            },
            "type": "OPEN",
            "userAgent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7 (via ggpht.com GoogleImageProxy)"
        },
        {
            "appId": 20185,
            "appName": "AbBatch",
            "created": 1401715744000,
            "emailCampaignId": 13054799,
            "hmid": "CiQ4ZWE5NTlmYy00MmU1LTRlZDctOTJjZC0zNjI0ZGRlNGYwODQQs+gDGNmdASAAKM/mnAYwoRY6Em1heGlha0BodWJzcG90LmNvbUCUhZPm5ShIAVooMWQ5NmYyODcyNDFjMmQzYWU1MDEwNTc3NmRkMDI5NzQ4ZjVjY2U3NXCR9A0=",
            "id": "e4e7b45d-83ff-3faa-81a5-d241a3ce6e31",
            "portalId": 62515,
            "recipient": "maxiak@hubspot.com",
            "response": "250 Thanks ",
            "sentBy": {
                "created": 1401715737236,
                "id": "8ea959fc-42e5-4ed7-92cd-3624dde4f084"
            },
            "smtpId": "<1114083043.73189221401715737245.JavaMail.root@hemingway>",
            "type": "DELIVERED"
        },
        {
            "appId": 20185,
            "appName": "AbBatch",
            "created": 1401715737236,
            "emailCampaignId": 13054799,
            "hmid": "CiQ4ZWE5NTlmYy00MmU1LTRlZDctOTJjZC0zNjI0ZGRlNGYwODQQs+gDGNmdASAAKM/mnAYwoRY6Em1heGlha0BodWJzcG90LmNvbUCUhZPm5ShIAVooMWQ5NmYyODcyNDFjMmQzYWU1MDEwNTc3NmRkMDI5NzQ4ZjVjY2U3NXCR9A0=",
            "id": "8ea959fc-42e5-4ed7-92cd-3624dde4f084",
            "portalId": 62515,
            "recipient": "maxiak@hubspot.com",
            "sendId": "1d96f287241c2d3ae50105776dd029748f5cce75",
            "sentBy": {
                "created": 1401715737236,
                "id": "8ea959fc-42e5-4ed7-92cd-3624dde4f084"
            },
            "subject": "test",
            "type": "SENT"
        },
        {
            "appId": 20185,
            "appName": "AbBatch",
            "created": 1401715737000,
            "emailCampaignId": 13054799,
            "hmid": "CiQ4ZWE5NTlmYy00MmU1LTRlZDctOTJjZC0zNjI0ZGRlNGYwODQQs+gDGNmdASAAKM/mnAYwoRY6Em1heGlha0BodWJzcG90LmNvbUCUhZPm5ShIAVooMWQ5NmYyODcyNDFjMmQzYWU1MDEwNTc3NmRkMDI5NzQ4ZjVjY2U3NXCR9A0=",
            "id": "c26a72e7-d78b-3ec0-8801-54d951608c48",
            "portalId": 62515,
            "recipient": "maxiak@hubspot.com",
            "sentBy": {
                "created": 1401715737236,
                "id": "8ea959fc-42e5-4ed7-92cd-3624dde4f084"
            },
            "type": "PROCESSED"
        }
    ],
    "hasMore": false,
    "offset": "Ch8KFgjImIKLlZvVgIgBEMD9rLz93Jy1wgEYqIOT5uUoFZRhY64="
}
 

As we can see above, we've queried for all events pertaining to a specific Email Campaign with the ID 13054799, this has then returned all events associated to this send which is related to the contact, maxiak@hubspot.com 

 

I hope this helps!

Product Manager @ HubSpot

View solution in original post

0 Upvotes
Willson
Solution
HubSpot Employee
HubSpot Employee

timeline activity for marketing emails

SOLVE

Hi @Elsssss,

 

In that case, yes. This endpoint linked previously should still provide the breakdown you're looking for as this can be queried per recipient address or Campaign Id. 

 

The recipient=X parameter will allow you to query event details associated to a specific send for a Contact whereas the default request using the campaignId=X will display all events for an email send. 

 

An example of the last request would be:

https://api.hubapi.com/email/public/v1/events?hapikey=demo&campaignId=13054799

Whereas if we include the recipient example:

https://api.hubapi.com/email/public/v1/events?hapikey=demo&campaignId=13054799&recipient=maxiak@hubspot.com

I hope this helps!

Product Manager @ HubSpot

View solution in original post

0 Upvotes
15 Replies 15
Willson
Solution
HubSpot Employee
HubSpot Employee

timeline activity for marketing emails

SOLVE

Hi @Elsssss,

 

This is possible through the use of our Email Analytics endpoint, specifically the Get email events API found here.

 

As per the documentation, you'll see that this endpoint is used to query the event log for events; which are defined here, matching specified parameters.

 

An example of this would be the following request:

Request: 
GET https://api.hubapi.com/email/public/v1/events?hapikey=demo&campaignId=13054799&limit=1&offset=Ch8KFgjC0cOq15yCtakBEOXx7NT479WQkgEYiNiW5uUo

Response:
{
    "events": [
        {
            "appId": 20185,
            "appName": "AbBatch",
            "browser": {
                "family": "Google Image Cache",
                "name": "Google Image Cache",
                "producer": "",
                "producerUrl": "",
                "type": "Proxy",
                "url": "",
                "version": []
            },
            "created": 1401715797602,
            "emailCampaignId": 13054799,
            "hmid": "ELPoAxjZnQEoz+acBjoSbWF4aWFrQGh1YnNwb3QuY29t",
            "id": "fb5f4051-0bf9-3b3c-92f4-ffbab071ed66",
            "location": {
                "city": "Unknown",
                "country": "Unknown",
                "state": "Unknown"
            },
            "portalId": 62515,
            "recipient": "maxiak@hubspot.com",
            "type": "OPEN",
            "userAgent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7 (via ggpht.com GoogleImageProxy)"
        },
        {
            "appId": 20185,
            "appName": "AbBatch",
            "browser": null,
            "created": 1401715797000,
            "emailCampaignId": 13054799,
            "hmid": "CiQ4ZWE5NTlmYy00MmU1LTRlZDctOTJjZC0zNjI0ZGRlNGYwODQQs+gDGNmdASAAKM/mnAYwoRY6Em1heGlha0BodWJzcG90LmNvbUCUhZPm5ShIAVooMWQ5NmYyODcyNDFjMmQzYWU1MDEwNTc3NmRkMDI5NzQ4ZjVjY2U3NXCR9A0=",
            "id": "9221577f-8a9b-38e5-a96a-08e57550e8c2",
            "location": null,
            "portalId": 62515,
            "recipient": "maxiak@hubspot.com",
            "sentBy": {
                "created": 1401715737236,
                "id": "8ea959fc-42e5-4ed7-92cd-3624dde4f084"
            },
            "type": "OPEN",
            "userAgent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7 (via ggpht.com GoogleImageProxy)"
        },
        {
            "appId": 20185,
            "appName": "AbBatch",
            "created": 1401715744000,
            "emailCampaignId": 13054799,
            "hmid": "CiQ4ZWE5NTlmYy00MmU1LTRlZDctOTJjZC0zNjI0ZGRlNGYwODQQs+gDGNmdASAAKM/mnAYwoRY6Em1heGlha0BodWJzcG90LmNvbUCUhZPm5ShIAVooMWQ5NmYyODcyNDFjMmQzYWU1MDEwNTc3NmRkMDI5NzQ4ZjVjY2U3NXCR9A0=",
            "id": "e4e7b45d-83ff-3faa-81a5-d241a3ce6e31",
            "portalId": 62515,
            "recipient": "maxiak@hubspot.com",
            "response": "250 Thanks ",
            "sentBy": {
                "created": 1401715737236,
                "id": "8ea959fc-42e5-4ed7-92cd-3624dde4f084"
            },
            "smtpId": "<1114083043.73189221401715737245.JavaMail.root@hemingway>",
            "type": "DELIVERED"
        },
        {
            "appId": 20185,
            "appName": "AbBatch",
            "created": 1401715737236,
            "emailCampaignId": 13054799,
            "hmid": "CiQ4ZWE5NTlmYy00MmU1LTRlZDctOTJjZC0zNjI0ZGRlNGYwODQQs+gDGNmdASAAKM/mnAYwoRY6Em1heGlha0BodWJzcG90LmNvbUCUhZPm5ShIAVooMWQ5NmYyODcyNDFjMmQzYWU1MDEwNTc3NmRkMDI5NzQ4ZjVjY2U3NXCR9A0=",
            "id": "8ea959fc-42e5-4ed7-92cd-3624dde4f084",
            "portalId": 62515,
            "recipient": "maxiak@hubspot.com",
            "sendId": "1d96f287241c2d3ae50105776dd029748f5cce75",
            "sentBy": {
                "created": 1401715737236,
                "id": "8ea959fc-42e5-4ed7-92cd-3624dde4f084"
            },
            "subject": "test",
            "type": "SENT"
        },
        {
            "appId": 20185,
            "appName": "AbBatch",
            "created": 1401715737000,
            "emailCampaignId": 13054799,
            "hmid": "CiQ4ZWE5NTlmYy00MmU1LTRlZDctOTJjZC0zNjI0ZGRlNGYwODQQs+gDGNmdASAAKM/mnAYwoRY6Em1heGlha0BodWJzcG90LmNvbUCUhZPm5ShIAVooMWQ5NmYyODcyNDFjMmQzYWU1MDEwNTc3NmRkMDI5NzQ4ZjVjY2U3NXCR9A0=",
            "id": "c26a72e7-d78b-3ec0-8801-54d951608c48",
            "portalId": 62515,
            "recipient": "maxiak@hubspot.com",
            "sentBy": {
                "created": 1401715737236,
                "id": "8ea959fc-42e5-4ed7-92cd-3624dde4f084"
            },
            "type": "PROCESSED"
        }
    ],
    "hasMore": false,
    "offset": "Ch8KFgjImIKLlZvVgIgBEMD9rLz93Jy1wgEYqIOT5uUoFZRhY64="
}
 

As we can see above, we've queried for all events pertaining to a specific Email Campaign with the ID 13054799, this has then returned all events associated to this send which is related to the contact, maxiak@hubspot.com 

 

I hope this helps!

Product Manager @ HubSpot
0 Upvotes
Elsssss
Participant

timeline activity for marketing emails

SOLVE

Hi @Willson , 

 

Thanks a lot for your quick reply, this definitly helps a lot! However, I am not very techinical, so yes I am happy that it is possible, but now I am wondering how to get this done :). 

 

Am I correct that all the data is therefore in the standard API from Hubspot, so therefore our technical guys that are using the API from Hubspot and connect it with the custom made CRM, should be able to implement this? Or does it need so work on the Hubspot side as well? They have no experience with Hubspot. 

 

THanks again! 


Regards, 

Els 

0 Upvotes
Willson
HubSpot Employee
HubSpot Employee

timeline activity for marketing emails

SOLVE

Hi @Elsssss 


You're correct, all this data is supplied as a standard via our APIs and therefore, if you have any technical teams that are working with the APIs already, they should be able to assist with using this endpoint and working with the data returned. 

 

I hope this helps!

Product Manager @ HubSpot
0 Upvotes
Elsssss
Participant

timeline activity for marketing emails

SOLVE

Hi @Willson , 

 

Thanks a lot! This definitly helped a lot! 

 

Regards, 

Els 

0 Upvotes
Elsssss
Participant

timeline activity for marketing emails

SOLVE

Hi @Willson

 

Just to be sure, are those api's also available when having a Hubspot Starter package? 

 

Thanks in advance!

 

Regards, 
Els 

0 Upvotes
Willson
HubSpot Employee
HubSpot Employee

timeline activity for marketing emails

SOLVE

Hey @Elsssss,

 

I can confirm that you should have access to this API in order to extract this data. 

 

Thanks!

Product Manager @ HubSpot
0 Upvotes
Elsssss
Participant

timeline activity for marketing emails

SOLVE

Thanks @Willson! And when we are having some questions during the process, can we reach out / hire you then as well for some consulting :)? 

 

0 Upvotes
Willson
HubSpot Employee
HubSpot Employee

timeline activity for marketing emails

SOLVE

Hi @Elsssss 

 

Unfortunately I am unable to assist in a consulting capacity but can assist with any issues you may run into with HubSpot functionality. 

 

If you're interested in building out an integration and would require some consulting services, take a look at our Technical Consultant services where a 4-hour block can be purchased.

 

This will allow you to work with a technical expert who will learn your business needs and systems inside and out to help you streamline processes, remove roadblocks and get the end result you're looking for.

 

I hope this helps!

Product Manager @ HubSpot
0 Upvotes
Elsssss
Participant

timeline activity for marketing emails

SOLVE

Hi @Willson

 

After contact with the customer we made some small adjustments to the Excel file that I send you (see image that I added). Can you maybe take another look to check if it is still possible to get this data from the Hubspot api, using the starter package? 

 

Is there a way that I can send you the excel file in the appendix? I added some comments in the document that are relevant.. 

 

Thanks in advance!

 

Regards, 

Els 

 

 

Hubspot image api.png

0 Upvotes
Willson
HubSpot Employee
HubSpot Employee

timeline activity for marketing emails

SOLVE

Hey @Elsssss,

 

Looking into the headers there (I assume this is what I am reviewing), can you confirm, are you looking to get this on a contact-by-contact basis or are you looking to get overview stats for an email send? 

 

The reason I ask above is that you're looking for total opens for a marketing email but then also asking for opens/clicks in a separate cell. What is the difference between the two here?

 

As mentioned previously, for the email events endpoint found here, the only scope access which is required is access to our Marketing Scope which is provided to a Marketing Starter account. 

 

I hope this helps!

Product Manager @ HubSpot
0 Upvotes
Elsssss
Participant

timeline activity for marketing emails

SOLVE

Hi @Willson 

 

Hopefully this is clear: I am looking to get this on a contact basis (on emailaddress), and then we will ask our CRM guy to aggregate the numbers so that we have it on a company level in the CRM. 

 

To clearify the number of opens:

  • Cell E4 =  number in cell is 6: Because this company record has 3 contacts, the number opens should be: 3 contacts opened all the email 2x. So the number will be 6.
  • Cell I4 = number in the cell is 350: This is the total number of opens (of the 400 contacts who received the marketing email) on this marketing email. 

Hopefully this makes sense and you can help me further? 

 

Thanks a lot!! 

 

Regards, 

Els 

0 Upvotes
Willson
Solution
HubSpot Employee
HubSpot Employee

timeline activity for marketing emails

SOLVE

Hi @Elsssss,

 

In that case, yes. This endpoint linked previously should still provide the breakdown you're looking for as this can be queried per recipient address or Campaign Id. 

 

The recipient=X parameter will allow you to query event details associated to a specific send for a Contact whereas the default request using the campaignId=X will display all events for an email send. 

 

An example of the last request would be:

https://api.hubapi.com/email/public/v1/events?hapikey=demo&campaignId=13054799

Whereas if we include the recipient example:

https://api.hubapi.com/email/public/v1/events?hapikey=demo&campaignId=13054799&recipient=maxiak@hubspot.com

I hope this helps!

Product Manager @ HubSpot
0 Upvotes
Elsssss
Participant

timeline activity for marketing emails

SOLVE

Thanks again @Willson. This definitly will help! 

0 Upvotes
Elsssss
Participant

timeline activity for marketing emails

SOLVE

Hi @Willson

 

Do you maybe have some time to help me out with this? 

 

Thanks in advance!

 

Regards, 

Els 

0 Upvotes
Elsssss
Participant

timeline activity for marketing emails

SOLVE

Thansk @Willson. That definitly makes sense! Thanks a lot. 

0 Upvotes