1 / 4
Sep 2012

Hi. I am tracking certain clicks on my site with GA event tracking, as well as running a jQuery script to trigger GA events for all outbound link clicks. I also want to enable ecommerce tracking of EJunkie sales. When I substitute the EJunkie version of GA tracking code my scripts stop working. So, how do I get GA event tracking and Ejunkie to work together?



This is the jQuery script that tracks the outbound links:



<script type="text/javascript">



$("a").on('click',function(e){

var url = $(this).attr("href");

if (e.currentTarget.host.replace(/[\d:]/g,"") != window.location.host) {

gaq.push(['trackEvent', 'Outbound Links', e.currentTarget.host, url, 0]);

if (e.metaKey || e.ctrlKey) {

var newtab = true;

}

if (!newtab) {

e.preventDefault();

setTimeout('document.location = "' + url + '"', 100);

}

}

});

</script>



And this is the script that enables GA event tracking of special links:



<script type="text/javascript">

function recordOutboundLink(link, category, action) {

try {

gaq.push(['trackEvent', category , action ]);

setTimeout('document.location = "' + link.href + '"', 100)

}catch(err){}

}

</script>



So how do I make these scripts work with Ejunkie's version of the GA tracking code? Has anyone ever gotten GA event tracking to work with Ejunkie ecommerce tracking?

  • created

    Sep '12
  • last reply

    Sep '12
  • 3

    replies

  • 1.1k

    views

  • 2

    users

  • 1

    link

We can really only support our own customized version of the GA code, and only if it's used as-is without modifications or additions, as documented here:

1http://www.e-junkie.com/ej/help.tracking.htm1



Otherwise, you'll need to stick with using Google's standard GA tracking code tailored to your needs, instead of using our version of the GA code, and that would be entirely up to you so sort out on your own. You can only use our version of the GA code as-is everywhere, or use the standard code from Google everywhere; they cannot be combined or mix'n'matched. By not using our version of the GA code, you would only lose the ability to track cart-button click events and lose the GA Ecommerce Tracking data we place in the thank-you pages we generate for you.

Right, I understand. I'm asking if anyone has been able to make event tracking work while using the customized Ejunkie code for ecommerce tracking. How would I have to modify the scripts I am running to make them work along side the Ejunkie GA code?

We can only support our version of the GA tracking code as-is and unmodified. If you want to do things with GA beyond what our version of the tracking code already supports, you would probably need to abandon using our GA code entirely, and instead use the standard GA tracking code/methods provided and documented by Google. For help with this, we would recommend contacting developers who specialize in Google Analytics implementation.