Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
Author « Topic »  

Bob88
Ecommerce Template Expert

958 Posts

Pre-sales questions only
(More Details...)

Posted - 03/23/2018 :  18:04:16  
Not sure if this is something you can help me with but I thought I'd give it a try.

Google requested I add Google analytics eCommerce tracking code on the order success page of the website, along with the dynamic variable.

Can anyone tell me what the "dynamic variable" is or where to find it?

GOOGLE CODE BELOW FOR THANKS PAGE:

<-------- GA Ecommerce Tracking Standard Code --------->

<script>

ga('require', 'ecommerce');

ga('ecommerce:addTransaction', {
'id': '1234', // Transaction ID. Required.
'affiliation': 'Acme Clothing', // Affiliation or store name.
'revenue': '11.99', // Grand Total.
'shipping': '5', // Shipping.
'tax': '1.29' // Tax.
});


ga('ecommerce:addItem', {
'id': '1234', // Transaction ID. Required.
'name': 'Fluffy Pink Bunnies', // Product name. Required.
'sku': 'DD23444', // SKU/code.
'category': 'Party Toys', // Category or variation.
'price': '11.99', // Unit price.
'quantity': '1' // Quantity.
});

ga('ecommerce:send');

</script>

Andy
ECT Moderator

95440 Posts

Posted - 03/24/2018 :  01:14:31  
Hi Bob

If you add this to includes.php

$usegoogleuniversal=true;

and this just before the closing </body> tag on all your store pages

<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create','UA-123456-1','auto');
ga('send','pageview');
ga('require','ecommerce','ecommerce.js');
<% print googleanalyticstrackorderinfo%>
</script>

You should get individual sales data reported in your GA account. Make sure you use your account id for UA-123456-1

Andy

Please feel free to review / rate our software

Bob88
Ecommerce Template Expert

958 Posts

Pre-sales questions only
(More Details...)

Posted - 03/24/2018 :  04:08:33  
Thanks for all the help with this.

Can you tell me if this should replace the Google code that's on all my pages now or is it in addition to the existing code? (See below)
______________________________________
______________________________________

<script type="text/javascript">

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){

(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)

})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create','UA-187315-1','auto');

ga('send','pageview');

ga('require','ecommerce','ecommerce.js');

<?php print @$googleanalyticstrackorderinfo?>

</script>



<!-- Google Code for Remarketing Tag -->

<!--------------------------------------------------

Remarketing tags may not be associated with personally identifiable information or placed on pages related to sensitive categories. See more information and instructions on how to setup the tag on: http://google.com/ads/remarketingsetup

--------------------------------------------------->

<script type="text/javascript">

/* <![CDATA[ */

var google_conversion_id = 1070168919;

var google_custom_params = window.google_tag_params;

var google_remarketing_only = true;

/* ]]> */

</script>

<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">

</script>

<noscript>

<div style="display:inline;">

<img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/1070168919/?value=0&guid=ON&script=0"/>

</div>

</noscript>

Andy
ECT Moderator

95440 Posts

Posted - 03/24/2018 :  04:24:49  
It seems you already have the code I posted, are you getting sales data in your GA account?

Andy

Please feel free to review / rate our software

Bob88
Ecommerce Template Expert

958 Posts

Pre-sales questions only
(More Details...)

Posted - 03/24/2018 :  04:47:52  
Yes we are getting sales data. Google just called and said we needed to add the code I posted above on the (thanks.php) page and started talking about needing to put the "Dynamic variable" in the code. I didn't know what they were talking about as I'm kind of self taught in this area. They said that if I didn't understand that I needed to find an IT guy that does. So I asked Liquidweb (Web Host) and they said they couldn't mess around with code on the site so I contacted you as a last resort.

I'm getting the feeling I'm getting in over my head. I'll leave things as they are for now.

Thanks a million for taking the time to help out though.

Edited by - Bob88 on 03/24/2018 05:07:03

asanborn
Ecommerce Template Guru

USA
1404 Posts

Pre-sales questions only
(More Details...)

Posted - 09/17/2018 :  10:21:51  
How can we add Google Analytics to ASP template?

Andy
ECT Moderator

95440 Posts

Posted - 09/17/2018 :  10:25:12  
Hi

You would add this to includes.asp

usegoogleuniversal=true;

And the GA code above to the dwt file.

Andy

Please feel free to review / rate our software
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.02 seconds. Snitz Forums 2000