E-junkie Help >

Google Analytics tracking with our classic cart

NOTE: This page only applies to sellers still using our classic cart (circa 2004-2018); for tracking integration with our current standard cart, see our main tracking help page here.

If you are not yet using our new cart, E-junkie's classic cart (now deprecated) was pre-integrated with Google Analytics if you use our custom version of Google's Analytics tracking code (given below); we can add cart-button click tracking to the regular Analytics page-traffic monitoring, and we also take care of context transfer and ensure that we don't report duplicate conversions if the buyer returns to their thank-you page again.

This will only work with the standard implementation of our cart, where the cart displays as an overlay within your page. Just make sure you have at least one block of your Cart Script code on every page that has any number of Add to Cart buttons, as that manages the overlay-style cart which is required to use our version of the Google Analytics tracking code.

Then, just place the following tracking code in every page of your site where you are using E-junkie cart buttons, and also in any other pages in your site where you wish to use Analytics tracking as well. You can paste this at the bottom of every page just before your </body> tag for optimal page-load performance, or you can place it between your page's <head> and </head> tags if you want to be sure it loads before anything else in the page for more consistent tracking. When you paste the tracking code, replace UA-XXXXXX-X with the ID provided to you in your code from Google Analytics.

This is the custom Google Analytics tracking code we provided for use with our classic cart (to track cart-button activity, use this version rather than the generic tracking code Google provides):

<script type="text/javascript">
var gaJsHost=(("https:"==document.location.protocol)?"https://ssl.":"http://www.");
document.write(unescape("%3Cscript src='"+gaJsHost+
  "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var ejGATracker = _gat._getTracker("UA-XXXXX-X");
ejGATracker._setDomainName("none");
ejGATracker._setAllowLinker(true);
ejGATracker._trackPageview();
</script>

Do not add any Analytics tracking code into your E-junkie Thank-you Page customization fields if you are using E-junkie Add to Cart/View Cart buttons and our version of the GA tracking code, as that would conflict with the integrated GA tracking data we already provide there automatically. However, if you are redirecting buyers to a Common Thank-you Page URL or using product-based Redirection URLs, then you should place our version of the Google Analytics code (as provided above) in your site's Thank-you/Redirection Page(s) as well.

How to trigger a conversion tracking pixel or Web beacon

Third-party tracking services (e.g., Google AdWords or independent affiliate systems) may track conversions by providing a snippet of tracking code that they require you to place on your post-checkout thank-you page. That method should work fine if you are selling downloads and using your standard E-junkie-generated thank-you/download pages, so you can just paste your conversion tracking code in Seller Admin > Manage Seller Account > Edit Preferences > Common Thank-you Page HTML (to have the same code added to every thank-you page we generate for you), or in the Product Thank-you Page HTML field of each product's settings (to have the code only added to thank-you pages when that particular item is purchased).

However, if you are redirecting to a thank-you page on your site or not selling downloads the way our system works may interfere with that method of conversion tracking, so our standard E-junkie Cart can now trigger a conversion-tracking URL (aka "tracking pixel" or "Web beacon" URL) without requiring you to add any tracking code to your thank-you pages. Simply add these lines to your View Cart code on every page, just after the line function EJEJC_lc(th) { return false; } in the standard View Cart code you obtain from Seller Admin:

function EJEJC_config() {
EJEJC_BEACON = "http://Put.Tracking.Pixel.or.Beacon.URL.Here";
}

For instance, your standard AdWords conversion tracking code would have a Web beacon tag like this:

<img height=1 width=1 border=0 src="https://www.googleadservices.com/pagead/conversion/1234567890/?value=1&label=purchase&script=0">

...so in that example, this would be the AdWords Tracking Beacon URL:

https://www.googleadservices.com/pagead/conversion/1234567890/?value=1&label=purchase&script=0

Which would look like this in our cart customization code:

function EJEJC_config() {
EJEJC_BEACON = "https://www.googleadservices.com/pagead/conversion/1234567890/?value=1&label=purchase&script=0";
}

Note that any & symbols in that URL must remain as a plain &, not converted to &amp; nor &#38;. If you are also using other cart customization code, just add the new EJEJC_BEACON line in place among the existing lines within your current function EJEJC_config(){} section.