APIs & Integrations

elsurudo
Member

Google Analytics source tracking – email ID lookup

SOLVE

Hello,

As per the article here, when sending email campaigns, Hubspot adds certain UTM parameters to links.

One of there is utm_content, which from the article above is set to "email ID number". I presume that this is some unique identifier for the Contact that clicked the link in the email.

Is there a way to do a reverse-lookup via the API using this "email ID number", and get back a Contact, or at the very least, an email address?

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Google Analytics source tracking – email ID lookup

SOLVE

Hi @elsurudo,

The "email ID number" refers to the email itself. If you navigate to the email tool and open an email, you will see a string of numbers in the URL.

For example, in the URL: https://app.hubspot.com/email/{your_hub_id}/details/1234567890/performance, 1234567890 is the email ID, which would populate the utm_content parameter.

It's possible to reverse-lookup the email which resulted in visits by copying the email ID into the email tool's URL, but only the tracking code can trace the visit back to a specific contact. This information is then viewable on the contact record and in several HubSpot reports.

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
4 Replies 4
IsaacTakushi
HubSpot Employee
HubSpot Employee

Google Analytics source tracking – email ID lookup

SOLVE

Apologies for the delayed response,@elsurudo,

Yep, I'm sure. The Source tracking section of this article describes how the utm_content parameter is filled with an email's ID when HubSpot marketing email tracking is enabled.

Perhaps the email you were looking for was deleted. Can you send me the full link you tried?

Yes, it's also possible to get email click data via the Email Events API. You can pull engagement data (including clicks) by recipient with this endpoint and the recipient parameter. The documentation includes some example responses.

Isaac Takushi

Associate Certification Manager
0 Upvotes
elsurudo
Member

Google Analytics source tracking – email ID lookup

SOLVE

Additionally, assuming a user has the tracking code installed, is it possible to get email link click data via API? If so, from which endpoint? I suspect it is the contacts endpoint, but clarification would be appreciated – especially around how the data would appear in the response.

Is it possible to view detailed event information for such link clicks, or just aggregate data?

Thanks for the help!

0 Upvotes
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Google Analytics source tracking – email ID lookup

SOLVE

Hi @elsurudo,

The "email ID number" refers to the email itself. If you navigate to the email tool and open an email, you will see a string of numbers in the URL.

For example, in the URL: https://app.hubspot.com/email/{your_hub_id}/details/1234567890/performance, 1234567890 is the email ID, which would populate the utm_content parameter.

It's possible to reverse-lookup the email which resulted in visits by copying the email ID into the email tool's URL, but only the tracking code can trace the visit back to a specific contact. This information is then viewable on the contact record and in several HubSpot reports.

Isaac Takushi

Associate Certification Manager
0 Upvotes
elsurudo
Member

Google Analytics source tracking – email ID lookup

SOLVE

Hello Isaac,

What you are saying makes sense, but are you sure that the utm_content param links to the email record? I tried to open a link similar to the one you posted (with my own Hub ID, of course), and the utm_content from the link in the email I received, but the page wasn’t found...

0 Upvotes