Could anyone clarify how the GA actions _gaq.push(['_link', <href>]); and _gaq.push(['_linkByPost', <form>]); work?
I’m not interested on how to use them as presented in the documentation. I understand those scenarios. I want to know more about what they do when called.
Edit:
I suspect how this works but I need some confirmation from someone that fiddled with this longer than me. I want to know what the process is in each of the cases in small steps. I know that it changes the sent data in order to overwrite to cookie on the target site, but I need to know exactly the actions that happen (in terms of JavaScript on the sending page) after you do the push.
I would also like to know if I could use _gaq.push(['_link', <href>]); from anywhere in my code to change the page.
Thank you,
Alin
We will assume
_gaq.push(['_setAllowLinker', true]);used on any needed page.What
_gaq.push(['_link', <href>]);does:__utm<x>cookies to<href>. You need to returnfalsein theonclickof the anchor so that the original link does not follow through.What
_gaq.push(['_linkByPost', <form>]);does:actionattribute of<form>so that it includes the__utm<x>cookies.What happens on the target page:
__utm<x>s are sent it overwrites its own cookies with these. This results in identifying the user as being the same on that left your original page.As a bonus
_gaq.push(['_link', <href>]);can be used in (almost) any situationwindow.open(<href>);can be used.