Hey there,
I’ve been wrestling with this one and I’m having a bit of an issue. I’ve finally linked up google analytics so that the ‘onClick’ trigger (replaced by a ga-track line) shows the interaction, but I’m looking to show the URL of an outbound link within that interaction on GA.
The initial solution to get the event to show was found here:
which was extremely helpful. The code shows certain perimeters that look like the could be altered to call for the link’s url, but I’ve had no luck.
The reason I’m doing this is because I have a series of randomized ads that need to be tracked when the ‘visit our sponsors’ button is clicked. They’re set up via the CMS, so the address is different depending on which ad pops up.
Any help in figuring out how to display the URL in the Event Catagory section of GA would amazing.
I’m not very code savvy, I can somewhat understand what I’m looking at but have had no luck in bashing with other code that would display the URL.
Will do. Thanks for the quick reply!
It’s the ‘Visit our Sponsors’ button. currently I’ve only attached the tracking to the top right hand button. https://www.durangotv.com/
Check out the missing data as well. You have the info there, but are missing the the data to track the link. Thats where you would setup your tracking UTM within GA and add that to your value attribute on the button itself. I think!
Sorry I’m not familiar with what UTM is if that covers the following.
Looking at the code (this is the only one that I was able to get to work), the person in the link had set this up so that those values are basically plain text that gets pushed to GA- they’re not actually representing anything within the code. Me calling them “trackOutboundLink, Type, etc” are just fillers. I’m not sure if there’s some code that I could put in the value, or on the back end, that would replace a parameter with the buttons’ URL.
Also, when I look at your code for the Attributes you do have some values, but are missing the tracking links for GA. UTM is ( Urchin Tracking Module), refer to this wiki: UTM parameters - Wikipedia
My suggestion is to use Google Tag Manager, which would create those parameters for you. Thats the top link.
Thank you, I’ll dig into that. And thanks very much for taking the time to help! I’m more a shapes and colors kind of guy so I’m a bit in over my head with this one.