Google Analytics: _linkbypost() on non-form cross domain links?
October 2, 2013 2:28 PM   Subscribe

I'm just curious is it possible (or advisable) to use _linkbypost() instead of just _link() on cross domain links with Google Analytics to avoid the problems I'm having with the long query strings that _link() produces.

Howdy,

_link() uses _GET to pass data by attaching a huge gibberish query string to the destination url which causes me a few headaches: It prevents my caching scheme (which keys off exact matching urls), drives many of my social media widgets crazy (which have proven super important to my business), wonks things out when someone bookmarks a page and shares it around, and just looks scary and ugly which I've found really does affect how much many users trust your site.

So I'm hoping I can get the same ability to track without losing my clean orderly cacheable urls by passing that data via post instead of get. But since I don't really understand how post works I don't know if this if feasible, or if it is just a really bad idea for some other reason.

Any advice? Thanks.
posted by Jezztek to Computers & Internet (3 answers total)
 
Response by poster: Oh, and just to clarify, I know _linkbypost() needs a form object to function, so my plan was to add an onSubmit function to each cross-domain link that would do the following:

create a simple form with the link's url as the action and add it to the dom
create a var 'myForm' pointing to the form
_gaq.push(['_linkByPost', myForm]
return false

Assuming it's not a bad idea to begin with, does that implementation seem reasonable?
posted by Jezztek at 3:02 PM on October 2, 2013


As a software engineer/web developer, I wish I had helpful advice to this particular question, but alas I do not. That being said, if you haven't already, I'd throw this up on stackexchange if you haven't already. Probably get a great answer.
posted by irishcoffee at 4:27 PM on October 2, 2013 [1 favorite]


Did you ever get an answer to this problem? I'm wondering the same thing myself!
posted by furtive at 3:16 PM on April 30, 2014


« Older As a resident alien, where can I donate against...   |   Where can I find reliable economic data for Iran? Newer »
This thread is closed to new comments.