I’ve set up a common handler to retrieve event tracking data from CTAs throughout the site as well as set up the attributes for each. However, it’s been a few days and still nothing from GA. None of my events are appearing on therefore not sure where I messed up. Help would be much appreciated.
hi @jose_llorens, when clicking on one of the links with the tracking, I am showing an error in the console, that is usually a good place to start looking:
That error usually means the GA tracking code script is not yet loaded, I did not see any google tracking snippet yet installed on the site, i.e:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
You should copy your own snippet from Google like above and paste into the head of your site and republish for the ga tracking event to fire successfully.
I would check that first, then see if the issue persists. P.s. when using the async snippet above, you can remove the analytics tracking code from the project settings SEO tab.
Also, on the integrations page, I’ve always had the universal tracking ID set up. I came across this message now, which doesn’t this contradict what you were saying??
A little confused as to which I should keep/remove and if I had the universal tracking ID the entire time, then why wouldn’t the event tracking be working?
Now, I have two tracking IDs for GA haha…one on the integrations section and one under header for custom code just to clarify.
Hi @jose_llorens, remove the code in the integrations page. If you are using the code snippet, there is no need to use the integrations tab. If you try to use both codes, the communications will likely fail to google.
Also, now when I click the button, no more console error, are you seeing any updates in your GA?