Forums / General Questions / Google Ecommerce Tracking

Google Ecommerce Tracking

Views: 37,009

Results 41 to 60 of 108
2 Jan 2016, 5:46 PM
#41
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Google Ecommerce Tracking

FYI PHP Fiddle is a very helpful tool for testing changes.. http://phpfiddle.org/

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

7 Jan 2016, 8:27 PM
#42
danielle avatar

danielle

Totally Zenned

Join Date:
Oct 2004
Posts:
973
Plugin Contributions:
0

Re: Google Ecommerce Tracking

I have setup the checkout labelling funnel steps as follows:

  1. Start Login
  2. Login Success
  3. Checkout Begin (FEC/COWOA)
  4. Start Payment
  5. Checkout Confirmation

We are using FEC. We are also using the feature of FEC that skips the confirmation page. So the customers enter payment, shipping, etc. in the one page checkout, click Confirm Order, and then are sent to the Checkout Success page. There is no order confirmation page. Do I need to make any adjustments to the steps above?

Thank you!

Danielle

8 Jan 2016, 3:34 AM
#43
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Google Ecommerce Tracking

Danielle:

Do I need to make any adjustments to the steps above?

No. Those steps are just fine. However, I will suggest that you are actually doing this a little backwards.

The reason being is that depending on the store setup (FEC, Standard checkout, PayPal/PayPal Express checkout, etc, etc) the actual steps being sent to Google analytics may/will vary from store to store.

So, since the exact steps are unknown, the best option (at least in my opinion) is to leave the Google settings at their defaults (step 1, step 2, step 3, etc) and let it accumulate the data from whatever is being sent to it from your particular store.

After a period of time (eg: A few hundred sales), the Analytics will show you enough data to clearly identify (for example) Step#1 equated to the 'Start Login' trigger, and that step#2 equates to the login success trigger, and that step#3 hasn't recorded any data (indicating that the confirmation page doesn't exist), and so forth.

Now, having said that, the module 'out of the box' is 'aware' of the different behaviour between a standard zencart checkout and the FEC checkout, so the Google servers will never 'see' the steps that are being skipped.

Anyway, the point I'm trying to make is that the data being sent to the GA servers needs to be determined first, and the 'Labels' that you give these events come afterwards - They are 'cosmetic' only. IOW, in a few months time you may get tired of seeing the the report heading of "Checkout Confirmation", in which case you can just go back to the steps editor and change Step#5 to read 'Order Confirmed'.
The graphed data won't change - Only the text itself.

If you wish to log more (or less) steps this will need some code editing of the module itself - BUT, this is also something that needs to be considered early in the game - If you start adding/removing steps after data has been accumulated things can be a real mess, existing data will be mapped to the 'new' step numbers so what was once correctly reported as step1 (login success) could now appear as being 'login start' if 'login start' was a new step#2 entry, making the original step#2 the new step#3 - etc...
There is no way to delete (or resync) existing/old data - other than deleting the account and restarting it afresh.

Cheers
RodG

       

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

1 Jun 2016, 11:43 PM
#44
rockwater avatar

rockwater

New Zenner

Join Date:
May 2016
Location:
Oregon
Posts:
11
Plugin Contributions:
0

Re: Google Ecommerce Tracking

We are experiencing an issue where two different tax amounts are getting logged. It seems to be adding WA state sales tax of 9.8 % to the “Product Revenue” based on the product price rather than Product Price + Shipping * sales tax….Which is Incorrect for us.

GA Sales Performance transaction report shows:

Revenue: $1,134.51 - Correct
Tax: $ 101.26 - Correct
Shipping: $ 35.26 - Correct

However, when you drilldown to the product it shows:

“Product Revenue: $1,095.80” - WRONG

The ACTUAL product revenue/price is $ 998.00

a) 998*9.8% = 97.804 + 998.00 = $ 1,095.80 – This is product revenue/price * sales tax and added together
b) 998 + 35.26 * 9.8% =101.26 +1033.26 = $ 1,134.51 – This is product revenue/price + shipping * sales tax and then added together

I didn’t see anyone in this thread having this issue, can you point me in the right direction if you are aware of this issue. OR point me to the correct line in class.ec_analytics.php to change how this is calculating tax and adding it to product revenue. Hopefully I explained this well enough.

Thank you in advance

6 Jun 2016, 9:21 PM
#45
rockwater avatar

rockwater

New Zenner

Join Date:
May 2016
Location:
Oregon
Posts:
11
Plugin Contributions:
0

Re: Google Ecommerce Tracking

NEVERMIND... I found where the tax was being added to the product price and removed it. Works correctly for us now.

6 Jun 2016, 9:22 PM
#46
rockwater avatar

rockwater

New Zenner

Join Date:
May 2016
Location:
Oregon
Posts:
11
Plugin Contributions:
0

Re: Google Ecommerce Tracking

Well, I thought changes we applied fixed the transaction dropping however, it randomly failed to log another transaction after applying the fixes in this thread.

9 Jun 2016, 6:34 AM
#47
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Google Ecommerce Tracking

rockwater:

NEVERMIND... I found where the tax was being added to the product price and removed it. Works correctly for us now.

So is this an issue with this module?? If so care to share your solution?

rockwater:

Well, I thought changes we applied fixed the transaction dropping however, it randomly failed to log another transaction after applying the fixes in this thread.

Well you are going to need to provide more detail than this if you are trying to get community support/help. (see the details I provided when I too had an issue with dropped transactions so you can see what kinds of data you should provide)

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

13 Jun 2016, 10:55 PM
#48
rockwater avatar

rockwater

New Zenner

Join Date:
May 2016
Location:
Oregon
Posts:
11
Plugin Contributions:
0

Re: Google Ecommerce Tracking

DivaVocals:

So is this an issue with this module?? If so care to share your solution?

This is what I changed to make the module calc the tax correctly for us. Remember in my previous posting I stated that in WA state tax is charged on shipping. This module was sending tax calculated on the product price and then adding it the product price, AND sending the tax value calculated from the cart which in our case is Product + Shipping X tax. So the solution is to remove the tax calc inside the module.

Line 102: . " 'price': '".number_format((float)($item['price'] + ($item['price'] * $item['tax_class_id'] / 100 )) ,6,'.','')."',"

Change to : . " 'price': '".number_format((float)($item['price']) ,6,'.','')."',"

Line 240: . " 'price': '".number_format($items_in_cart->fields['final_price'] + ($items_in_cart->fields['final_price'] * $items_in_cart->fields['products_tax'] / 100 ),6,'.','')."',"

Change to: . " 'price': '".number_format($items_in_cart->fields['final_price'],6,'.','')."',"

31 Dec 2016, 11:20 AM
#49
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Google Ecommerce Tracking

Hi

Just curious, installed this mod yesterday. In the analytics.google.com report under under "All Web site data"/Channels/default channel grouping/Referrals there are a couple of sessions today for paypal.com.

Nobody bought anything via paypal (or failed to purchase) so why/how would paypal be referring potential customers to my site?

3 Jan 2017, 11:13 AM
#50
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Google Ecommerce Tracking

marton_1:

Hi

Just curious, installed this mod yesterday. In the analytics.google.com report under under "All Web site data"/Channels/default channel grouping/Referrals there are a couple of sessions today for paypal.com.

Nobody bought anything via paypal (or failed to purchase) so why/how would paypal be referring potential customers to my site?

Found a fix for this

Make sure you are using Universal Analytics
Admin -> Property Settings -> Tracking Info -> Referral Exclusion List
Add Referral Exclusion
Insert referral domain - my case was paypal.com
6 Apr 2017, 10:19 AM
#51
adrian_cioc_rlan avatar

adrian_cioc_rlan

New Zenner

Join Date:
May 2016
Location:
Bucharest
Posts:
48
Plugin Contributions:
0

Re: Google Ecommerce Tracking

Hi,

First of all, Thanks for this great plugin, I have it installed on our website and it works fine.

Recently we set up an AdWords campagin and we would like to use Adwords conversion tracking.

Can anyone tell how/where to put the Adwords code?
I want to make sure it compatible safe with this plugin.

I read this threat about how to install the code. https://www.zen-cart.com/showthread.php?142133-Adwords-conversion-tracking
Is It ok to follow the steps schoolboy suggested in the above threat?

Thank You!
Adrian

18 May 2017, 10:52 AM
#52
webchills avatar

webchills

Zen Follower

Join Date:
Sep 2005
Location:
Austria
Posts:
99
Plugin Contributions:
1

Re: Google Ecommerce Tracking

Adrian Ciocîrlan:

Recently we set up an AdWords campagin and we would like to use Adwords conversion tracking.
Can anyone tell how/where to put the Adwords code?
I want to make sure it compatible safe with this plugin.
There is no need for adding an additional Adwords conversion script. It would even be contraproductive as the RodG plugin will not work correctly anymore if an additional Adwords conversion tracking is added to the checkout success page.
Just make sure that your Google Analytics account is linked with your Adwords account and you will see everything in Analytics. If the conversion came from an adwords campaign you will see that in Analytics.
I have implemented the findings and fixings from this thread to an updated version of this great plugin and removed some unneccessary code for the specific client it was once written. Will submit it to the download section soon and put it on GitHib as well.

12 Jul 2017, 12:00 PM
#53
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Re: Google Ecommerce Tracking

Hi all, my knowledge isn't very advanced so I wanted to check if I have installed the plugin correctly. It was very simple to install! I had different codes and an old plugin (Easy Google Analytics) installed but have now removed all of the old codes and files. I haven't removed anything from the database or run an uninstall script, should I do this?

My website is - https://www.welsh-lovespoons.co.uk/

The following code now appears on each of our pages. Is this correct? Many thanks.

Attachment 17136

13 Jul 2017, 4:30 AM
#54
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Google Ecommerce Tracking

bonheddwr:

Hi all, my knowledge isn't very advanced so I wanted to check if I have installed the plugin correctly.

A good rule of thumb - if it is working, it is almost certainly installed correctly :)

bonheddwr:

It was very simple to install!

:) :) :)

bonheddwr:

I had different codes and an old plugin (Easy Google Analytics) installed but have now removed all of the old codes and files.

The only code that I know of that would be relevant is the UA-xxxxxxxxx-y (User Account), and this would typically be the same for both the old plugin and this one (assuming the same site is being monitored).

bonheddwr:

I haven't removed anything from the database or run an uninstall script, should I do this?

This question is the main reason for my reply - In an ideal world, and assuming that you have removed all the 'old codes and files' ALONG with any other code modifications associated with the old plugin, and also assuming that there is an uninstall script available, then yes, you should do this - BUT, that is a lot of assumptions and we don't live in an ideal world so deleting stuff from a database, either manually or with a script, poses certain risks. It only takes one file to try to reference missing DB data to cause the site to crash.

If you have any doubts whatsoever that you haven't 'undone' all file changes associated with the initial install then leave the database alone.
A database with fields/entries that are no longer needed are completely harmless.

bonheddwr:

The following code now appears on each of our pages. Is this correct?

Yes, that looks correct.

It also shows that when you took this screenshot you was actually logged into the site as a customer :)

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

26 Jul 2017, 12:52 PM
#55
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Re: Google Ecommerce Tracking

Thank you so much for replying above Rod. I've had this installed on the site for around two weeks. I installed this because the Google Analytics code I used previously was only recording a few of the transactions when visiting the google Analytics site (Conversions>Transactions) but the majority were not being recorded. Unfortunately even though page views etc are being recorded correctly it seems the transactions are still not being recorded using this plugin. Has anyone else had the same issue? I spoke to somone from the Google 'Tag implementation team' over a week ago on the phone and after an hour he came up with this code to be inserted at the bottom of tpl_checkout_success_default.php , and when I did a test transaction and paid via my own paypal account the transaction was recorded, but none of the orders since have been recorded! I may be going around things the wrong way, but what I simply want is that all orders are recorded in Analytics, and in Adwords I can compare how much a campaign has cost for a certain period compared to the amount of revenue generated from those Ads during that period.

Would really appreciate any advice!

<?php
$sql_ordertotal = 'select REPLACE (text,"$","") text from orders_total where orders_id = '.$zv_orders_id.' and class = "ot_total"';
$to_send= $db->Execute($sql_ordertotal);
$order_total    =    $to_send->fields['text'];

$sql_ordershipping    = 'select REPLACE (text,"$","") text from orders_total where orders_id = '.$zv_orders_id.' and class = "ot_shipping"';
$to_send    = $db->Execute($sql_ordershipping);
$order_shipping    =    $to_send->fields['text'];

$sql_tax    = 'select order_tax from orders where orders_id = '.$zv_orders_id;
$to_send    = $db->Execute($sql_tax);
$order_tax    =    $to_send->fields['order_tax'];
?>
<script type="text/javascript">
ga('require', 'ecommerce');
var cartTotal = '<?php echo $order_total; ?>';
var CartShipping = '<?php echo $order_shipping; ?>';
var CartTax = '<?php echo $order_tax; ?>';
ga('ecommerce:addTransaction', {
  'id': <?php echo $zv_orders_id ?>,// Transaction ID. Required.
  'affiliation': 'welsh-lovespoons.co.uk',       // Affiliation or store name.
  'revenue': parseFloat(cartTotal.replace(/[^0-9.]/g,'')),// Grand Total.
  'shipping': parseFloat(CartShipping.replace(/[^0-9.]/g,'')),// Shipping.
  'tax':parseFloat(CartTax.replace(/[^0-9.]/g,''))// Tax.
});
<?php
$sql_orderproducts    = 'select * from orders_products where orders_id = '.$zv_orders_id;
$row_orderproducts    = $db->Execute($sql_orderproducts);
while(!$row_orderproducts->EOF){
$category_id =    zen_get_products_category_id($row_orderproducts->fields['products_id']);
$category_name = zen_get_categories_parent_name($category_id);
?>
ga('ecommerce:addItem', {
  'id': <?php echo $zv_orders_id ?>,// Transaction ID. Required.
  'name': '<?php echo $row_orderproducts->fields['products_name']?>',// Product name. Required.
  'sku': 'SKU<?php echo $row_orderproducts->fields['products_model']?>',// SKU/code.
  'category': '<?php echo $category_name?>',// Category or variation.
  'price': <?php echo number_format($row_orderproducts->fields['products_price'],2)?>,// Unit price.
  'quantity': <?php echo $row_orderproducts->fields['products_quantity']?>// Quantity.
});
<?php
$row_orderproducts->MoveNext();
}
?>
ga('ecommerce:send');
</script>
26 Jul 2017, 3:32 PM
#56
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Google Ecommerce Tracking

ga('ecommerce:addItem', { 'id': <?php echo $zv_orders_id ?>,// Transaction ID. Required. 'name': '<?php echo $row_orderproducts->fields['products_name']?>',// Product name. Required. 'sku':

I am currently knee-deep in nitpicking this plugin to death, to
a) suit my shop and also
b) default shops,

for Google Analytics Enhanced Ecommerce.

I wish to point out that that this bit of code is for Google Analytics Ecommerce Tracking and not for Google Analytics Enhanced Ecommerce. There are differences, minor as they are.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

27 Jul 2017, 7:05 AM
#57
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Google Ecommerce Tracking

bonheddwr:

Thank you so much for replying above Rod. I've had this installed on the site for around two weeks. I installed this because the Google Analytics code I used previously was only recording a few of the transactions when visiting the google Analytics site (Conversions>Transactions) but the majority were not being recorded. Unfortunately even though page views etc are being recorded correctly it seems the transactions are still not being recorded using this plugin.

Sorry, but I'm a wee bit confused here.. I'm looking at
https://analytics.google.com/analytics/web/

... but I can't seem to find Conversions>Transactions

I am seeing
Conversions>Goals
Conversions>E-Commerce
Conversions>Multi-channel Funnels
Conversions>Attribution

But no Conversions>Transactions

The sales transactions can be seen at Conversions>E-Commerce>Sales Performance.

Here's a screenshot of what you should be seeing (captured just now, todays last 10 sales)

Attachment 17183

As you can (hopefully) see - all of the TransactionID's are in sequence - no missed sales.

bonheddwr:

Has anyone else had the same issue?

Some folk have reported some products not being reported/recorded with this module (as I recall, due to apostrophes in the product titles that the module isn't properly escaping, but I don't recall any reports of nothing being recorded at all.

Hmm, did you enable the the Enhanced Ecommerce reporting (on the Analytics website)?
Admin->view->Ecommerce settings
Tick the boxes to 'Enable Ecommerce'
Set the 'Enabled Enhanced Ecommerce Reporting' to 'On'

bonheddwr:

I spoke to somone from the Google 'Tag implementation team'

Perhaps you should be speaking to someone from the Ecommerce Analytics team instead - This has nothing to do with 'Tag implemantion' - That's a whole different kettle of fish.

bonheddwr:

over a week ago on the phone and after an hour he came up with this code to be inserted at the bottom of tpl_checkout_success_default.php ,

He has screwed you over (putting it bluntly) - The entire point of my creating this module is so that you don't have to modify any zencart code.
He has also provided you with old code - Not the 'Enhanced Ecommerce' code (that the ec module is using).

At the moment (assuming you still have this 'new' code added you are effectively doubling up on the reporting - Google Analytics will either fail to record either, or it will be ignoring one of them. Which one being ignored will possibly be determined by the aforementioned 'Enabled Enhanced Ecommerce Reporting' setting.

bonheddwr:

and when I did a test transaction and paid via my own paypal account the transaction was recorded, but none of the orders since have been recorded! I may be going around things the wrong way, but what I simply want is that all orders are recorded in Analytics, and in Adwords I can compare how much a campaign has cost for a certain period compared to the amount of revenue generated from those Ads during that period.

Adwords is yet another beast entirely.

bonheddwr:

Would really appreciate any advice!

My advice would be to firstly remove any code that you have added to any pages. The ec_analytics module was created specifically to avoid having to do this - and by using this module plus the page additions will cause problems.

My next suggestion would be to fire up a Chrome browser, and add the Google Analytics Debugger plugin
https://chrome.google.com/webstore/detail/google-analytics-debugger.

With this installed, and navigating your site (add product, remove product, checkout, etc, etc) you can right click on the page(s) and click the 'inspect' button. This will basically show you exactly what the ec_analytics code is doing on any given page - including the exact data being sent to the Google servers. This will identify any problems or issues.

It's a pretty nifty little add-on - however, it may be a little difficult to understand (depends on skill level).

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

27 Jul 2017, 11:07 AM
#58
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Re: Google Ecommerce Tracking

Thank you very much for your detailed response.

I’m sorry, it should have read Conversions>E-Commerce>Transactions. Mmm, my Google Analytics layout looks slightly different to yours, and all transactions should be listed here not under Sale Performance. As you can see (by the huge gaps between Transaction / order numbers), only a few transactions are being recorded.

'Enabled Enhanced Ecommerce Reporting' was set to ‘Off’, I have now set it to ‘On’. I’ll see if this makes any difference. Thanks for the suggestion.

Thanks for the very detailed comments regarding code I will look into this now! Thanks again, Hedd.

27 Jul 2017, 11:43 AM
#59
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Re: Google Ecommerce Tracking

My advice would be to firstly remove any code that you have added to any pages. The ec_analytics module was created specifically to avoid having to do this - and by using this module plus the page additions will cause problems.

I've removed the extra code suggested by the 'Tag implementation team' now, and after loging in to analytics again, it now looks like yours. The plugin is now the ONLY Analytics code included anywhere on our site (I hope!)

Adwords is yet another beast entirely.

Does that mean I need to add a different Adwords code as well? From my understanding from speaking to the Adworeds representative on the phone, he took me through connecting Analytcis and Adwords so the same results should show up in both, I think! It used to be so simple!

My next suggestion would be to fire up a Chrome browser, and add the Google Analytics Debugger plugin... It's a pretty nifty little add-on - however, it may be a little difficult to understand (depends on skill level).

And therein lies the problem. I can add plugins, and edit files if I'm told what to do, but that's far as it goes! My understanding when anything goes wrong is next to zero! I wonder if you know of an expert I could pay at an hourly rate, maybe using Google hangouts to see what's happening when I place the order, and why it isn't being recorded in analytics, and help me to correct it? Thanks for all of your support, really appreciate it.

27 Jul 2017, 11:56 AM
#60
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Re: Google Ecommerce Tracking

PS, I don't know if this could be the issue, but we use worldpay and paypal for payments. The URL people arrive at after paying for an order using Worldpay is similar to this. Even though it is our website that appears, the URL is actually secure.worldpay.com . Could this be an issue as to why the orders aren't being recorded?

Attachment 17184