Board Logo

Inserting code for Google Analytics tracking across domains
Bewildered - 9/22/2008 at 08:49 PM

I'm using Tigra Menu Gold on a multi-domain site, and I want Google Analytics to track users across the domains. This is described on...

Item 2 on this page says...

2. Next, you'll need to add the _link function to any links between the domains. Please note that your analytics tracking code and calls to _gat._getTracker (shown in Step 1) must be placed on the page above the call to _link. If your current links look like:

<a href=""> Login Now</a>

change them to:

<a href="" onclick="pageTracker._link(this.href); return false;">Login Now</a>

Basically, they are saying that in addition to the href attribute, the A tag should contain this attribute...

onclick="pageTracker._link(this.href); return false;"

Of course, The Tigra menu doesn't use A tags or href attributes. The code in Items.js for a typical button in my Tigra menu is like this...

[['<img src=>', '<img src=>','<img src=>'], '', {'sw':75},
['About Us', ''],
['Our Mission', ''],
['Our Approach', ''],
['Industries & Clients', ''],

So my question is, how would I add...

onclick="pageTracker._link(this.href); return false;" the links in this code as instructed by Google?

(I notice that the Tigra files -- menu.dom.js, menu.js, menu.opr.js, and menu.lay.js -- all contain "onclick". So I'm guessing that I need to tuck the Google onclick in with the onclick that's already in these files. Exactly how do I do that?)

Thank you.

tigra - 9/22/2008 at 10:17 PM

Tigra Menu Gold does use <a href="..."> (you can find that code in menu.dom.js, menu.lay.js and menu.opr.js) but onclick is already taken.

try replacing
onclick="return menus['',,''].exec('',,'',0)"
onclick="pageTracker._link(this.href); return false;"
in all three files

Back to forum: