Google analytics and conversion tracking

General ShopSite user discussion

Google analytics and conversion tracking

Postby notquitelooneytunes » Thu Sep 20, 2012 12:21 pm

Google's instructions for adding the analytics code on pages is to insert the code into the <head> section and to add the conversion code in the <body> section. However if you look at the thankyou.cgi page that Shopsite generates, the conversion code is inserted before the analytics code and both are in the body section. Is this a flaw in Shopsite? I have spent way too much time trying to get shopsite to work with conversions.
notquitelooneytunes
 
Posts: 4
Joined: Thu Sep 20, 2012 12:10 pm

Re: Google analytics and conversion tracking

Postby Jim » Thu Sep 20, 2012 1:53 pm

It does not matter where the code is placed as long as the function is defined before it is used. In ShopSite 11sp2 this is how the info displays on the thankyou screen.
Code: Select all
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-123456-1']);
_gaq.push(['_trackPageview']);
</script>
<script type="text/javascript">
(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>
<script type="text/javascript">
_gaq.push(['_addTrans', "1346","","6.27","0.07","5.20","Orem","UT","Australia"]);
_gaq.push(['_addItem', "1346","SKU2134","!test","Products","1.00","1"]);
_gaq.push(['_trackTrans']);
</script>
</body>


So the function is defined before the _qaq.push is used.

If you are not seeing conversion coming through then something else is not configured correctly. There are lots of people who are using GA with ShopSite so it is not a general problem that you are encountering.

What type of Google Analytics are you using? They have had at least 3 different versions.

Did you enter your information into ShopSite on Merchandising > Google Services > Google Analytics screen and letting ShopSite generate the code? Or are you trying to put it into the html pages yourself, either through editing the html, entering it in a text field in ShopSite or through a custom template?

Do you have the same domain for your store pages and shopping cart and thank you screens or are there different domain names?
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Google analytics and conversion tracking

Postby notquitelooneytunes » Thu Sep 20, 2012 2:32 pm

The analytics code is the same version you are using. Here is the Google conversion code that I got from them to put on the thank you page. This is separate from the analytics code, which I inserted through the wizard in shopsite. (I X-ed out the ID):

<!-- Google Code for Sale Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = -;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "TsQZCPeO6AMQ45Xu_gM";
var google_conversion_value = 0;
/* ]]> */
</script>
<script type="text/javascript" src="https://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="https://www.googleadservices.com/pagead/conversion/1071352547/?value=0&amp;label=TsQZCPeO6AMQ45Xu_gM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>
notquitelooneytunes
 
Posts: 4
Joined: Thu Sep 20, 2012 12:10 pm

Re: Google analytics and conversion tracking

Postby Jim » Thu Sep 20, 2012 2:47 pm

Have you tried putting it in the Commerce Setup > Order System > Thank You > Text at top (or bottom) of Thank You Screen field?
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Google analytics and conversion tracking

Postby loren_d_c » Thu Sep 20, 2012 2:51 pm

That Adwords Conversion Tracking code has nothing to do with Google Analytics, it is independent of the Analytics code. But according to this Google article, you don't even need that additional code if you link your AdWords and Analytics accounts together, then AdWords can just get the info from Analytics:

http://support.google.com/adwords/bin/answer.py?hl=en&answer=2375435

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: Google analytics and conversion tracking

Postby notquitelooneytunes » Thu Sep 20, 2012 3:12 pm

I put the code on the Commerce Setup > Order System > Thank You > Text at bottom.
Loren is right, the conversions show up under the google analytic account, but the new conversion optimizer has you put this on any page that has a conversion, whether it is the contact page or thank you page to verify a sale.
I am sure the analytics is linked to the Adwords, because it is showing all stats in analytics. Is anyone else doing the conversion optimizer, which is a different section under the adwords tools?
notquitelooneytunes
 
Posts: 4
Joined: Thu Sep 20, 2012 12:10 pm

Re: Google analytics and conversion tracking

Postby carbonguy33 » Tue Jun 18, 2013 5:46 pm

Hi There - did you find a solution.. I have been wrestling with some of the same issues over the last month...

Glenn
carbonguy33
 
Posts: 1
Joined: Tue Jun 18, 2013 5:42 pm

Re: Google analytics and conversion tracking

Postby wmbaskets » Tue Jul 02, 2013 12:33 pm

What about Facebook? I want to track conversions for a Facebook ad I created and FB says the code MUST be placed in the <HEAD> section of the page that you want to track conversions to.

In my case, I'm not looking to see if the ad leads to purchases; I just want to see if people visit my home page as a result of viewing the ad. So I would need to be able to put the FB code in the <HEAD> section of my home page http://www.wonderfullymadebaskets.com/store/index.html

I tried adding the code to the "header" section of "Layout Settings" under "Preferences" but it is placing the code in the <BODY> section when I do that.

How can we ad code to the <HEAD> section of a ShopSite page?
wmbaskets
 
Posts: 15
Joined: Sun Jun 23, 2013 10:42 pm

Re: Google analytics and conversion tracking

Postby Jim » Tue Jul 02, 2013 1:38 pm

See my answer to your other post. Please just post a question in one place. It takes time to answer the questions and if a question is in multiple places that time adds up.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: No registered users and 78 guests