RSS

Blog

Hacking jQuery Thickbox to add Google Analytics and permalink support

h36 Jan 2008 –  Comments (5)

Comments

Alternately, couldn't you just add a click function to the elements that trigger the thickbox, and add your GA tracking there? I have an example of this here: http://blog.rebeccamurphey.com/2008/01/06/track-outbound-clicks-with-google-analytics-and-jquery/

[] rdmey ~ 2 years, 1 month ago at 8:47 a.m.

rdmey:

Yeah I would use a method similar with normal outbound links like pdf or image files, it also work for Thickbox, but only if you don't use the gallery feature, in this case only the first link will be clicked. After the user will click next and the click will not be "recorded".

That's why I had to hack the Thickbox code.. There is probably other way to hack it without touching Thickbox's code, but I though it was the simpliest way.

Cheers

[] h3 ~ 2 years, 1 month ago at 11:16 a.m.

So.... did it work?

[] JGarrido ~ 1 year, 5 months ago at 12:21 a.m.

Hi,

I used location.href but it could not work properly. Here is the code: $j('#Join_now').click( function() {location.href='{URL_TSYS.signup}'} );

Join_now is button

Could you please help me to fix this out?

Thanks

[] Vietnam Software Outsourcing ~ 1 year, 5 months ago at 6:48 a.m.
[] first page google ~ 1 year, 3 months ago at 3:43 a.m.

Copyrighted stuff .. u know.