4 / 4
Jul 2010

Hi,

I'm a little confused about implementing google analytics in conjunction with e-junkie. e-junkie provides the following code:



<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-xxxxxx-x");

ejGATracker._setDomainName("none");

ejGATracker._setAllowLinker(true);

ejGATracker._trackPageview();

</script>



Google Analytics provides another to be put before the </body> tag. My questions are the following:



1. Do I have to insert both of these codes or just the e-junkie one?

2. Where do I place the e-junkie code? Instructions say at the bottom..but more specifically before which tag?



Thanks!

  • created

    Mar '09
  • last reply

    Jul '10
  • 3

    replies

  • 1.0k

    views

  • 3

    users

  • 5

    links

If you want to use Google Analytics along with the Analytics tracking features built into our cart and buttons, then you should only use the special version of GA tracking code provided by E-junkie (instead of the generic tracking code provided by Google):

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



This can really go anywhere in your page, as long as it's between <body> and </body> -- it's generally a good idea to put it just before the </body> tag, or as close as you can get it down towards that end of your page.



Bear in mind that you should NOT place our GA tracking code in any E-junkie Thank-you Pages, as that would conflict with the tracking code we already have in there.

1 year later

This whole analytics process is begging for some expert systems coding: user clicks down through a series of questions, out pops the correct procedure.



This was a helpful answer. My take home: two options for Thank You pages:



1. E-Junkie hosted: Do nothing on thank you page, put EJ GA code on your sales page with cart button (which I don't want to have viewable).



2. Personally hosted: Put EJ GA code on sales page and Thank You page as long as you're using the Cart button. The Buy Now button is different, I forget how.



Flowcharts, man, flowcharts!



Am I missing them?

I already posted this in reply to another post of yours, but just in case anyone else is reading along here or stumbles across this particular thread in the future...



The basic rules of thumb are:



- If you're using the standard E-junkie Cart and Cart Buttons codes (where our cart appears as an overlay "inside" your page), put our special version of the GA tracking code in your site's pages, but don't add it to your E-junkie-generated thank-you pages;



- If you're using any other button codes (including if you're using our cart buttons in a manner where the cart appears in a separate window/tab), just use GA's standard tracking code in your site's pages AND add it to your E-junkie-generated thank-you pages;



- Whichever version of the GA tracking code you're using, make sure you're using only that version everywhere -- i.e., don't mix'n'match using our version of the GA code on some pages with GA's standard code on other pages, and certainly don't put both on the same page! :^)