3
votes

I run this web site http://www.workingdays.us on which many links are javascript actions (within the home page) I want to be able to trace with Google Analytics.

Exemple :

<a id='m1d'  href='#am1d' onclick="increment_changed('nb_j',-1);"  class='plus_moins' title='Remove one day to the period' >-</a>

But In page analytics is displaying for each of those javascript links same "82%" (see screenshot) which obviously is wrong.

enter image description here

I think have followed google guidelines regarding "enhanced link attribution" https://support.google.com/analytics/answer/2558867?hl=en and I don't understand what's wrong

1- my google code analytics is up to date

<script type='text/javascript'>var _gaq = _gaq || [];
var pluginUrl = 
'//www.google-analytics.com/plugins/ga/inpage_linkid.js';
_gaq.push(['_require', 'inpage_linkid', pluginUrl]);
_gaq.push(['_setAccount', 'UA-17269285-3']);_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);

})();

2- All my links have a unique id

3- Enhanced link attribution option is enabled within google analytic's admin panel

2

2 Answers

0
votes

I'm having the same problem with links pointing to the same page, such as tabs that just show or hide page elements. I would like to see which tabs are actually being clicked on and I haven't been able to get it to work with enhanced link attribution. I too have ids in each of the tab links.

I guess the only workaround I see at this time is to actually do event tracking. That data won't show on the inPage though.

0
votes

I have exactly the same issue. I tried debugging linkid.js. It seems to work. It saves the clicked element's id in a cookie named _gali that expires after 30s. But still I cannot see any clicks on links handled with javascript in Page Analytics.

https://www.screencast.com/t/65W3OPLzF98I

On navigation though the last clicked link id is being sent to analytics with the pageview event. For instance if you click a tab and then refresh the page within 30 seconds.

https://www.screencast.com/t/3QFV9VdiUgM

That makes me think that the clicked link id might be sent out with other events than pageview. It might be worth trying to trigger an event in analytics when tabs are being clicked.