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
Author « Topic »  

atlend
Advanced Member

USA
319 Posts

Posted - 06/22/2018 :  09:11:47  
I have the code setup per the instructions. The adwords people gave me the following code:

Hi, I was on the phone with the adwords people and they told me to put the following code.

It appears that the use of @$googleanalyticstrackorderinfo adds the information about the order. Is this code including the 'ecommerce:addItem' and 'ecommerce:addTransaction' and 'ecommerce:send'?

Another way to ask this is what is the complete output for @$googleanalyticstrackorderinfo so I can compare it against what they are wanting me to have in my code.

The code they sent me:
<script type="text/javascript">
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 - 06/22/2018 :  09:28:25  
Hi Chris

In Google Analytics if you go to Conversions > Ecommerce > Product Performance you should see what is reported by the GA code we supply regarding ecommerce data.

Andy

Please feel free to review / rate our software

atlend
Advanced Member

USA
319 Posts

Posted - 06/26/2018 :  09:12:16  
I dont have anything recording. Is there a reason that the <?php print @$googleanalyticstrackorderinfo?> would not produce the necessary code on the thanks.php page. Isnt showing up on the source code for the thanks page on a test order.

includes:
$googleanalyticsinfo=TRUE;
$usegoogleuniversal=TRUE;

thanks:

<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','myUA#','auto');
ga('send','pageview');
ga('require','ecommerce','ecommerce.js');
<?php print @$googleanalyticstrackorderinfo?>
</script>

Any other factors that could be preventing?

Andy
ECT Moderator

95440 Posts

Posted - 06/26/2018 :  09:16:52  
I don't think those would show in the source code but in your Google Analytics admin, under Admin > View

Check you have this turned ON

Enable E-commerce
Use the E-commerce developer reference guide to properly set up the tracking code for your site.

Andy

Please feel free to review / rate our software

atlend
Advanced Member

USA
319 Posts

Posted - 06/26/2018 :  10:01:20  
The goolge people are telling me that I should add something like this to the thanks page (with dynamic values):

<script type="text/javascript">
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>


Does this look right to you, and how do I get the dynamic values for each of these items.

Thanks!

dbdave
ECT Moderator

USA
10291 Posts

Posted - 06/26/2018 :  10:14:40  
Others have posted here the variables that you need to insert.
Try the search and you might find them.
I have them for .asp, and have shared that in the past, but i'm not sure on .php
They have been posted before, so I believe you should be able to locate it.

One more thing. I do use this too, but I also use the affiliate program and assign a "partner ID" to my ad links, so I can use the affiliate program to see my ad return.
I'm not sure google really needs to see that info is my point.

Edited by - dbdave on 06/26/2018 10:19:25

atlend
Advanced Member

USA
319 Posts

Posted - 06/26/2018 :  10:46:18  
All of the posts I see show <?php print @$googleanalyticstrackorderinfo?>

I'm guessing it is supposed to produce that output, but that is not very clear. It doesnt produce any output in my test.

dbdave
ECT Moderator

USA
10291 Posts

Posted - 06/26/2018 :  19:18:35  
No, the ect code does not pass the order details to google adwords.

The suggested code you have passes quite a bit of order details on to google, so you need to insert numerous variables.

The code I use just passes the order (products before shipping) and I have it below.
As you can see in green, I have inserted the .asp variable for the order total.
This is what you need. The .php variables.

They are formatted differently for .php

<!-- Google Code for purchase complete Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = provided-by-google-inserted-here;
var google_conversion_language = "en";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "provided-by-google-inserted-here";
var google_conversion_value = <%= ordTotal %>;
var google_conversion_currency = "USD";
var google_remarketing_only = false;
/* ]]> */
</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="//www.googleadservices.com/pagead/conversion/provided-by-google-inserted-here/?value=<%= ordTotal %>&currency_code=USD&label=provided-by-google-inserted-here&guid=ON&script=0"/>
</div>
</noscript>

dbdave
ECT Moderator

USA
10291 Posts

Posted - 06/26/2018 :  19:24:15  
You must get the .php variables and insert in the place I have marked in green
I am not convinced they are all available on the thanks page.
I know the order total and ID can be passed, but this is a complicated request and if you are not up to task on doing it yourself, it may be best to ask in the developers section.

<script type="text/javascript">
ga('require', 'ecommerce');
ga('ecommerce:addTransaction', {
'id': 'Order ID Variable', // Transaction ID. Required.
'affiliation': 'The Name of your store', // Affiliation or store name.
'revenue': 'Grand total Variable', // Grand Total.
'shipping': 'Shipping total Variable', // Shipping.
'tax': 'Tax Variable' // Tax.
});

ga('ecommerce:addItem', {
'id': 'order ID Variable', // Transaction ID. Required.
'name': 'Product Name Variable', // Product name. Required.
'sku': SKU Variable', // SKU/code.
'category': 'Category Variable', // Category or variation.
'price': 'Price Variable', // Unit price.
'quantity': 'Quantity Variable' // Quantity.
});

ga('ecommerce:send');
</script>

Edited by - dbdave on 06/26/2018 19:25:27

dbdave
ECT Moderator

USA
10291 Posts

Posted - 06/26/2018 :  19:43:42  
Ok, I did some extensive searching and came up with some relevant threads.

https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=109706
here you can see Bob88 asked for the same as you - as you can see he gave up

https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=109159
Here you can see another user asked for some variables for something different, and Mike (terrific 3rd party developer) offered to help.
You might ask him to take a look at your needs.

https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=108588
Here is a two page thread where they were asking for "conversion" tracking similar to what I use. When you get to the 2nd page, you will see where I tried to assist.
It seems there is confusion as to what's being asked for, just the same as this thread.

As you can see, the php variable for order (subtotal) is <?php print $ordTotal; ?>
So, you need to find all the variables and fill them in, written like so
<?php print $ordTotal; ?>;


So, looking at your original code, I have filled in two of the known variables.
Again, I am not convinced they are all available and I am not sure why you want to share such detailed info about your orders with google anyway.

<script type="text/javascript">
ga('require', 'ecommerce');
ga('ecommerce:addTransaction', {
'id': '<?php print $ordID; ?>', // Transaction ID. Required.
'affiliation': 'Acme Clothing', // Affiliation or store name.
'revenue': '<?php print $ordTotal; ?>', // Grand Total.
'shipping': '5', // Shipping.
'tax': '1.29' // Tax.
});

ga('ecommerce:addItem', {
'id': '<?php print $ordID; ?>', // 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>


Rereading that thread in the last link, on the 2nd page, there is mention of using the ect data for the analytics code.
In a post by Phil it looks like he is showing results of product data. The problem is getting adwords to see the analytics data.
Again, maybe a task for a 3rd party developer.

Maybe just implement the code for passing the order total rather than the individual products purchased. In that case, the code is there in that thread.

Edited by - dbdave on 06/26/2018 19:55:50

Andy
ECT Moderator

95440 Posts

Posted - 06/27/2018 :  00:02:52  
To be honest I don't think you need any extra code on thanks.php. Make sure your site is set as an ecommerce site in Google Analytics as I mentioned before.

Check you have this in includes.php

$usegoogleuniversal=TRUE;

and this just before the closing </body> tag on all your pages, including thanks.php

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

Andy

Please feel free to review / rate our software

dbdave
ECT Moderator

USA
10291 Posts

Posted - 06/27/2018 :  05:50:17  
Yes, it does seem to have individual product info as Phil posts here - https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=108588&whichpage=2

quote:
The results on the thanks page give the following:
ga('ecommerce:addItem',{'id':'17932','name':'EVERLASTO WAXED SASH CORD No.2 RED WRAPPER 6mm x 10m','sku':'SCR21','category':'No.2 (6mm) Red Wrapper Sash Cord','price':'7.23','quantity':'1'});


And maybe Andy can answer this, but I always thought the ect code was for google analytics, but Andy, are you saying Google adwords should be able to see this as well?

Andy
ECT Moderator

95440 Posts

Posted - 06/28/2018 :  07:00:21  
quote:
but I always thought the ect code was for google analytics
Sorry, I missed your question. Adwords reporting is available in Google Analytics so that will show too. You do need to make sure the code we provide comes just before the closing <body> tag as that means it will come after the incthanks include line that is required.

Andy

Please feel free to review / rate our software

inlays
Starting Member

USA
11 Posts

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

Posted - 07/08/2018 :  17:34:03  
We faced similar issue that Adwords did not record properly transaction conversion value. The current code supported by template is not passing it correctly to Adwords from Analytics.
Working with Google I modified our site and it is working now.
In the header for all pages added:

[code]<!-- Global site tag (gtag.js) - Google AdWords: 1XXXXXXX -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-1XXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'AW-1XXXXXX');
</script>[/code]

and then at the bottom of thanks.asp page

[code]<script>
gtag('event', 'conversion', {
'send_to': 'AW-1XXXXXX/YYYYYYYYYYY',
'value': <%=ordGrandTotal%>,
'currency': 'USD',
'transaction_id': <%=ordID%>
});
</script>[/code]

This code can be tested using Google Tag Assistant extension in Chrome.

Edited by - inlays on 07/08/2018 17:34:47
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000