Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 10-31-2017 13:30:32

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1716

Google Analytics duplicate transactions

Hi Nick

Is there any way a user can re hit the google analytics tracking to create multiple instances of the same transaction with analytics?

Example, customer created and completed an order on 9 October. Google analytics have corrected tracked this order as a sale on 9 October. Today, the exact order number has been tracked again, meaning analytics is showing the value twice for different days.

This is happening alot. Google is showing 200 sales more than the site has actually done in October, so financially there is a big difference and they are all duplicate transcations.

With ccp8, we used to get a few discrepancies, but nowhere near this amount.

So basically, is there anyway the customer can re hit the analytics tracking code.


Rob

Offline

 

#2 11-01-2017 08:27:10

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19861
Website

Re: Google Analytics duplicate transactions

The only scenario in which I could see this happening is if the customer bookmarks their order confirmation page and then access that bookmark to visit your site.  We saw this happening with duplicated paypal payments in V8 and lower, and early on in K9 development put measures in to combat it, but it looks like analytics could be affected by the same thing.  It's become more common over the past few years for customers to bookmark order confirmations as record of their transactions, believe it or not.  Are these duplicates typically days later?


Nick Hendler

Offline

 

#3 11-01-2017 10:14:17

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1716

Re: Google Analytics duplicate transactions

The duplicates can be weeks later.

I have tried getting to the order confirmation page, and clicking refresh, but I can't get analytics to duplicate the order, so I have got no idea how they occur.

I have also tried modifying orders in the POS, again, I can't get any duplicates.

I will monitor it and see what happens, and I will check through my analytics set up again.


Rob

Offline

 

#4 11-02-2017 08:02:18

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19861
Website

Re: Google Analytics duplicate transactions

Thank you.  What you've tried is not what I'm thinking it might be.  To test, place an order and bookmark your order confirmation page.  Close your browser and drink a coffee.  Come back, open your browser, access the bookmark to load the order confirmation page.  I'm suspecting analytics fires and Google logs the duplicate.  Perhaps only X days in the future.


Nick Hendler

Offline

 

#5 11-02-2017 08:16:38

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1716

Re: Google Analytics duplicate transactions

Doesn't happen from a bookmark, and I'm not sure it can.
Order confirmation page is /index.php. Refreshing the order confirmation page directs to homepage. Saving and clicking bookmark directs to home page as well. So we can't hit the analytics code twice.


Rob

Offline

 

#6 11-03-2017 09:09:16

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19861
Website

Re: Google Analytics duplicate transactions

Try to bookmark an order confirmation page for a gateway like PayPal for which the return URL is actually a redirect link with an order number and status in it.


Nick Hendler

Offline

 

#7 11-03-2017 13:24:19

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1716

Re: Google Analytics duplicate transactions

that is the problem - if you refresh the confirmation page, you will get duplicate data in analytics and adwords.

So, I guess the answer would be to edit jslib.php, and only print the analytics script if the order epochtime was within 15 minutes of current epoch time. This should prevent the huge majority of duplicates as they all seem to be days in the future.

Code:

$now = $this->globals('core_datetime.epoch');

if ($now-$order['order']['epochorder']>900){$gaid='';}

if ((!(empty($gaid))) && ($interface == 'FrontEnd')) {.....................

Any other ideas?

Last edited by zanart (11-03-2017 13:25:53)


Rob

Offline

 

#8 11-06-2017 07:50:25

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19861
Website

Re: Google Analytics duplicate transactions

We'll add something for this in the next update.  Probably will be done in the OrderMan class in the orderprocess() function so that the analytics order variable is only populated if processing was done.  Your mod will work, but 15 minutes is not long enough.  We've seen people take up to a day to get through checkout, believe it or not.  Another recent behavior trend.  Customers are loading checkout on multiple sites to get true shipping/tax info then checking out on the site with the best deal at a later time.  I would think 3 hours covers nearly 100% of users, though.


Nick Hendler

Offline

 

Board footer