AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

5.4K members online now
5.4K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
Guide Me

Using 'return false;' preventing linking in Chrome

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

We have cross domain tracking set up for ecommerce purposes, and for the moment we are stuck using classic Google Analytics until we roll out Universal for all of our properties. So, while I understand switching to Universal will fix this, I have to work with Classic and for the moment, we're dealing with this glitch for Chrome users.


Nothing happens when a Chrome user clicks "Buy Now". Removing "return false" fixes the issue but then prevents cross domain tracking. The inclusion of "return false" is required for this analytics installation to track the session from our domain to our third-party shopping cart domain.





<a href="" onclick="_gaq.push(['_link', this.href]); return false;">Buy Now</a>


Analytics Snippet:


function trackOutboundLink(link, category, action) {
try {
_gaq.push(['_trackEvent', category , action]);
} catch(err){}

setTimeout(function() {
document.location.href = link.href;
}, 100);

var _gaq = _gaq || [];
var pluginUrl = '//';

_gaq.push(['_require', 'inpage_linkid', pluginUrl]);
_gaq.push(['_setAccount', 'MY_UA_ID_IS_HERE']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript';
ga.async = true;
ga.src=('https:' == document.location.protocol ? 'https://ssl' :
'http://www') + '';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);

Using &#39;return false;&#39; preventing linking in Chrome

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

I have a similar problem. Did you find a solution?

Using &#39;return false;&#39; preventing linking in Chrome

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

No. And no agency we spoke to was able to determine a solution. We ended up having to switch to Universal Analytics.