Vim Bonsu
Vim Bonsu

Reputation: 1892

How to convert ga.js method to analytics.js code

Upgrading my site from ga.js legacy to analytics.js. I have a piece of code from classic ga.js that I need to upgrade to universal analytics.

How do I upgrade this code onsubmit="ga(['_linkByPost', this]); return true;" to universal analytics code? I use this code on a form for cross domain linking. Now I just have to figure out how to convert this to universal analytics.

Upvotes: 0

Views: 239

Answers (1)

apires
apires

Reputation: 927

I think that you need to use linker.

ga('linker:autoLink', ['example-2.com'] );

See if this is what you're looking for:

https://support.google.com/analytics/answer/1034342?hl=en

https://developers.google.com/analytics/devguides/collection/analyticsjs/linker?hl=en

Upvotes: 1

Related Questions