Newsletter's 'top clicked links'


#1

I am trying to recreate a newseltter's top clicked links report on my website using the API.

I am able to get a list of all events for the newsletter in question using https://api.hubapi.com/email/public/v1/events?eventType=CLICK&emailCampaignId=MY_CAMPAIGN_ID and then looping until hasMore is none.

I get all the results but how can I get a friendly name for the URL it returns?

I also note that the events returned for the campaign are not an exact match for the count when I do https://api.hubapi.com/email/public/v1/campaigns/MY_CAMPAIGN_ID

Any one know how I can recreate this report from the API as I feel I am 90% there but just cant do it with the data available.


#3

Hi @adrian1,

The Email Events API doesn't return the titles of clicked URLs and the research I've done suggests this isn't possible through a URL alone. If you were on the page, for example, you could pull the document.title, but I haven't found any other way to get the value.

That said, the only time I've seen "friendly names" for the clicked links in an email's Top clicked links report is when they're HubSpot CTAs. Most reports simply show the raw URL, per the screenshot below.


#4

Hi Isaac,

Is there a way to determine if the link is a CTA or not and if it is get the CTA name from the API?

Adrian


#5

Hi @adrian1,

I would expect only CTA links to include parameter cta_guid, followed by a long string.

At this time, there are no public CTA APIs from which names can be pulled.