Assitance with Setting up Google Analytics Tracking for Cart

General ShopSite user discussion
Post Reply
Rgkopchak
Posts: 61
Joined: Wed Jul 28, 2010 7:45 am
Location: Missouri

Assitance with Setting up Google Analytics Tracking for Cart

Post by Rgkopchak »

I've never been able to get Google Analytics to work properly with my cart. Looks like things have changed quite a bit since I set up ShopSite originally, so I'm trying to give it another go.

Right now I am referencing the instructions found here: https://www.shopsite.com/templates/cookbook/ga-enhanced-ecommerce.html

Right now I've got the follow code in each section of my cart:

Code: Select all

		<script type="text/javascript">        
		var _gaq = _gaq || [];
		_gaq.push(['_setAccount', 'UA---X']);
		_gaq.push(['_trackPageview']);
		
		(function() {
		  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
		})();      
		  
		</script>
This does the job of analytics tracking, and then on the "Thank You" page I've got the following:

Code: Select all

<!-- Google Code for Thank You Page Conversion Page -->
				<script type="text/javascript">
				/* <![CDATA[ */
				var google_conversion_id = 1008683109;
				var google_conversion_language = "en";
				var google_conversion_format = "2";
				var google_conversion_color = "ffffff";
				var google_conversion_label = "7e9kCMOO6QEQ5ZD94AM";
				var google_conversion_value = 0;
				/* ]]> */
				</script>
				<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
				</script>
				<noscript>
				<div style="display:inline;">
				<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1008683109/?label=7e9kCMOO6QEQ5ZD94AM&guid=ON&script=0"/>
				</div>
				</noscript>
This does register as a "conversion" in Google Analytics... but doesn't have the $ values.

If I follow the instructions for "GA enhanced ecommerce", should I REMOVE this code... or leave it and ADD the new code?

Thanks in advance for any assitance you can provide... this has always been something missing from our shopsite experience, so I am hoping I can fix it!
cyoung
Posts: 147
Joined: Wed Nov 09, 2016 11:01 am

Re: Assitance with Setting up Google Analytics Tracking for

Post by cyoung »

On the thank you page, this line:

var google_conversion_value = 0;

should be:

var google_conversion_value = ss_ordertotal;
Rgkopchak
Posts: 61
Joined: Wed Jul 28, 2010 7:45 am
Location: Missouri

Re: Assitance with Setting up Google Analytics Tracking for

Post by Rgkopchak »

Good catch! I'll change that ASAP, but I'm still left wondering if I should ADD the code listed "Ga enhanced" or REPLACE this code with that...

I do appreciate the assistance here!
Post Reply