Track a URL clicked in Embedded Tweets

javascript

#1

I would like to track url’s and hashtags which are clicked.
I would likely track these at the aggregated level as my main purpose is to measure engagement with the tool.
I would like to track anything that is clicked which opens a pop up, opens a tab, or redirects the user.
I have used the Scripting: Events Documentation to track tweets and retweets, but I would like to track other social platforms as well as clicking on individual tweets or url’s within tweets.

I have attempted to use the code in the documentation, but I seem to only get a click event with an Intent to Like or an Intent to Retweet is clicked.

function clickEventToAnalytics (intentEvent) {
if (!intentEvent) return;
var label = intentEvent.region;
console.log(‘twitter code’, intentEvent, label);
}
twttr.events.bind(‘click’, clickEventToAnalytics);

Please advise if I am doing something incorrectly.

Thanks!


#2

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.