开发者

Google Analytics with asynchronous Calls to two different accounts

I have a flash site that calls a JavaScript function to track events inside of the application, the _gaq is already implemented in the section of the html and it works perfectly fine with one account:

function customTracker(clickEventName) 
{  
    _gaq.push (["_trackPageview", clickEventName]); 
}

but now my custom开发者_开发知识库er wants to include special events from 3rd party companies and needs these to track into a different GA account. Before I try this out on the live server I wanted to ask if this would work:

function customTracker(clickEventName) 
{  
    _gaq.push(["_setAccount", "UA-XXXXXXXXX-X"]); // the regular account
    _gaq.push (["_trackPageview", clickEventName]); 
}

function customThirdPartyTracker(clickEventName) 
{  
    _gaq.push(["_setAccount", "UA-XXXXXXXXX-X"]); // the new account for third party tracking
    _gaq.push (["_trackPageview", clickEventName]); 
}

I found similar questions on StackOverflow but the answer was only 'to use the new asynchronous tracking' but no word on how to really implement it.

Thanks in advance for any advice.


There's no problem sending data to multiple GA accounts so your code should work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜