Tagged: google analytics, social media buttons
Hi,
I’m trying to track user clicks on the Social Media links in the header bar via Google Analytics (Universal) event tracking. I’ve followed the instructions I found at https://kriesi.at/support/topic/tracking-of-header-social-buttons-in-google-analytics/ and replaced the Google Analytics Asynchronous code with the Universal code but it doesn’t seem to work ….
I’ve replaced replaced
onclick=’_gaq.push([‘_trackEvent’, ‘ClickLink’, ‘”. $search_array[static::$social_counter].”‘, ‘Message’])’
with
onClick=’ga(‘send’, ‘event’, ‘ClickLink’, ‘”. $search_array[static::$social_counter].”‘, ‘Message’);’
When I render the page in Google Chrome and inspect the Social Media elements, the code seems OK except the quotation marks look miss-formed and muddled … I get the following code … double quotes around the “ga” and the rest single quotes … not sure if this is the reason the tracking doesn’t work or something else?
onclick=”ga(” send’, ‘event’, ‘ClickLink’, ‘Facebook’, ‘Message’);’
Does anyone know the correct way to get this to work? Any help or advice would be gratefully received
Many thanks in advance
Problem solved. In case of use to anyone the onClick line should read …
onClick=\”ga(‘send’, ‘event’, ‘ClickLink’, ‘”. $search_array[static::$social_counter].”‘, ‘Message’);\”
Hey!
Glad you figured it out!
For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)
Cheers!
Yigit