Share via E-Mail
Share on Twitter
Share on Facebook
E-junkie Blog
E-junkie FaceBook Page
E-junkie @ Twitter

E-junkie Ecommerce Forums » E-junkie Discussions

Tag Cloud for this topic:

Ejunkie + event tracking in Google Analytics



Seancho
member
Posts: 2


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?


#
POSTED ON: September 20, 2012 @ 21:56 GMT -7




E-junkieGuru
E-Junkie Crew
Posts: 4354


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:
http://www.e-junkie.com/ej/help.tracking.htm

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.


#
POSTED ON: September 20, 2012 @ 22:42 GMT -7




Seancho
member
Posts: 2


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?


#
POSTED ON: September 20, 2012 @ 23:51 GMT -7




E-junkieGuru
E-Junkie Crew
Posts: 4354


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.


#
POSTED ON: September 23, 2012 @ 15:05 GMT -7


You must be logged in to make a post. Please click here to login.

30 Day Money Back Guarantee
PayPal Certified Integration
Google Checkout Certified Integration
Slam the Online Scam