6 / 6
Mar 2014

I'm trying to get Total cost of purchase, sku, city, etc. passed to google analytics. After enabling ecommerce in GA

I know the following code E-junkie code is not good enough....



<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>



SO, I added the javascript part to it and it still does not work (the following):



<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-796508-1");

ejGATracker._setDomainName("none");

ejGATracker._setAllowLinker(true);

ejGATracker._trackPageview();



pageTracker._addTrans(

"order-id", // required

"affiliate or store name",

"total",

"tax",

"shipping",

"city",

"state",

"country"

);



pageTracker._addItem(

"order-id", // required

"SKU",

"product name",

"product category",

"unit price", // required

"quantity" //required

);



pageTracker._trackTrans();

</script>





Does anyone know what I am missing?



Thanks!



Matt

  • created

    Jan '09
  • last reply

    Mar '14
  • 5

    replies

  • 1.8k

    views

  • 2

    users

  • 7

    links

I'll have to ask Development to look into this, as it appears you're trying to do something above and beyond the standard Analytics integration we document and officially support.



I can tell you that for order payments made via Google Checkout, GC is able to directly transmit eCommerce data for tracking, regardless of whether the buyer continues past checkout to any conversion/thank-you page with tracking code.

Tyson thanks for responding.



All of my Google Checkout orders get read, and I can see revenue.



It seems like pretty straightforward solution as Google Analytics paints a pretty easy explaination here - >



http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55528



These methods must live on the receipt page. I have put it on my thank you page and no luck.



Please check this article, that's how I understand this process :



http://www.epikone.com/blog/2008/01/22/google-analytics-e-commerce-tracking-pt-2-installation-setup/



Perhaps I need to use a different thank you page method (try the customizable on provided in the "manage your own products" page.



Also another solution I was thinking was placing the code on the actual cart page.



Thanks for your reply and looking forward to a response.

Tyson,



Let me also add that this would make us seriously consider another shopping cart.



If we can't track revenue from source, what's kind of Google Analytics integration is that?



Not much.



I hope we can find a custom remedy, because I've loved your product thus far.



Matt

5 years later

Someone else recently referenced this thread to inquire about Google Analytics Ecommerce Tracking, so thought I'd post a followup here in case anyone else with similar questions may happen across this thread.



When you use our Cart buttons and our customized version of the GA tracking code on your site, the thank-you pages we generate for you will automatically include Ecommerce Tracking data for GA to pick up whenever we detect the buyer's browser has a cookie that was set by our version of the GA tracking code. See this help page for our custom GA code and further details/instructions:

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