Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

X-Payments with Google Analytics Conversion Code
 
Reply
   X-Cart forums > X-Payments > X-Payments issues & questions
 
Thread Tools
  #1  
Old 05-06-2013, 07:46 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default X-Payments with Google Analytics Conversion Code

Anyone using Google Analytics with conversion tracking and X-Payments?

I use AlteredCart CheckoutOne w/ XPC so it may be my mod, but...

I have discovered that *my* Google Analytics conversion code is NOT tracking when paid by credit card (x-payments). Now, it very well could be my AlteredCart mod.... but just in case it isn't:

Can someone please verify (yes it will require a test transaction)...

1. make sure your google analytics code is on and tracking ecommerce.
2. make an order, pay with credit card (x-payments)
3. when you get back to the success page:
/cart.php?mode=order_message&orderids=XXXXX
3. TURN ON webmaster mode (reload order_message page)
LOOK for variable:
{$ga_track_commerce}
it should be "Y" - but in my store, when paying by credit card, {$ga_track_commerce} is "N" ??????

If {$ga_track_commerce} is "N", all kinds of tracking data fails to send.

This has been a TOTAL PITA to troubleshoot this.
Is this my custom XPC code?

Anyone else wondering if their GA conversion tracking has not been working right?
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #2  
Old 05-08-2013, 05:33 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: X-Payments with Google Analytics Conversion Code

This gets interesting...

Bill @ AlteredCart asked me to disable chekout_one and checkout with only stock OPC and x-payments.

I did a test order with C1 disabled.
And the order_message "success page" source contains all the GA code (and it reported to GA). That's good.
And the conversion code and sales data appears almost instantly in GA. That's good.

HOWEVER - this is now getting strange┘

If you look at the variables in the order_message page, the variable, {$ga_track_commerce} is set to "N" ???? yes, with only x-payments and OPC, the variable, {$ga_track_commerce} is set to "N"

But if {$ga_track_commerce} is N, then why/how are the 3 transaction variables showing, because in the template,

/skin/common_files/modules/Google_Analytics/ga_code_async.tpl

there is an if...

Code:
{if $config.Google_Analytics.ganalytics_e_commerce_analysis eq "Y" and $ga_track_commerce eq "Y" and $main eq "order_message" and $orders } // Ecommerce Tracking for order_message page
etc┘

SO - if {$ga_track_commerce} is N, the tracking scripts shouldn't appear. Right?

BUT -- if I turn C1 off and use xcart OPC, $ga_track_commerce is N, but all tracking code is there.
AND -- if I turn C1 back on, $ga_track_commerce is also N, but all tracking code is missing.

Any ideas what's going on here?

Very confused.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #3  
Old 05-08-2013, 09:38 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: X-Payments with Google Analytics Conversion Code

OK. Now this is getting interesting.

Bill suggested looking at file,

/include/checkout_init.php

about line 506, you will see

Code:
$smarty->assign('ga_track_commerce', $ga_track_commerce); $ga_track_commerce = 'N';

Hold on there!

IF $smarty->assign('ga_track_commerce', $ga_track_commerce); is supposed to take the setting from $ga_track_commerce and assign it to smarty, why is the very next line changing this back to 'N' regardless of the switch setting in the google analytics module?

Bill's suggestion was to force the switch to Y, and that does solve the issue -- x-payment credit card sales now have GA tracking code on order_message

Code:
// next line commented out to force ga_track_commerce to Y // $smarty->assign('ga_track_commerce', $ga_track_commerce); $smarty->assign('ga_track_commerce', 'Y'); // next line changed from N to Y // why is line in the code at all? $ga_track_commerce = 'Y';

Surely others must be missing their google analytics tracking if this switch is forced to N

Anyone know what's actually going on here?

PS -- with this edit, all sales now track to GA, all conversion code is present in order_message, as it's supposed to be.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #4  
Old 05-09-2013, 07:18 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: X-Payments with Google Analytics Conversion Code

I just got off the phone with a senior code guy from Google Adwords/Analytics (in India) and he thinks the x-cart code is a mess - but without knowing the reasons WHY the kludgy redundancies, he can't make suggestions to improve it.

He confirmed that the last round of edits that I made were working -- we did a bunch of test transactions starting with AdWords as well as organic search as well as just typing in my URL. We checked out with paypal and credit card. We confirmed that the brute-force edits that we made put the correct code into the order_message success page in all situations, and now, finally, my site is tracking correctly.

But using the stock GA code, especially since using x-payments, the tracking has not been working.

I URGE everyone using x-payments to triple check their GA tracking code and verify conversion tracking. You may be surprised at what you find.

If X-cart wants to know what I learned here, please ask, and I will share.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote

The following 3 users thank carpeperdiem for this useful post:
ambal (05-09-2013), cflsystems (05-09-2013), gb2world (05-09-2013)
  #5  
Old 05-09-2013, 11:20 PM
  ambal's Avatar 
ambal ambal is offline
 

X-Cart team
  
Join Date: Sep 2002
Posts: 4,106
 

Default Re: X-Payments with Google Analytics Conversion Code

> If X-cart wants to know what I learned here, please ask, and I will share.

Yes, sure! I am puzzled with this issue myself, too.
__________________
Sincerely yours,
Alex Mulin
VP of business development for X-Cart
X-Payments project manager
Reply With Quote

The following user thanks ambal for this useful post:
gb2world (05-10-2013)
  #6  
Old 11-26-2014, 07:26 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 796
 

Default Re: X-Payments with Google Analytics Conversion Code

Glad I found this as I am tearing my hair out wondering why the asynch code is not outputting to the order message page on my 4.6.1 site using any method of payment. I too found that $ga_track_commerce is setting itself to N. I have altered the checkout_init.php to say 'Y' and it now works. was there an offoical reason for this or ane explanation?
__________________
4.4.2

and

4.6.1
Reply With Quote
  #7  
Old 11-26-2014, 08:05 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 796
 

Default Re: X-Payments with Google Analytics Conversion Code

Actually asynch code is still not ouputting but 'traditional' now code is after the change - is asynch code meant to appear on the order_message page or is it hidden is some javascript somewhere?
__________________
4.4.2

and

4.6.1
Reply With Quote
  #8  
Old 12-22-2014, 01:45 AM
  ambal's Avatar 
ambal ambal is offline
 

X-Cart team
  
Join Date: Sep 2002
Posts: 4,106
 

Default Re: X-Payments with Google Analytics Conversion Code

I am stickying this thread.
__________________
Sincerely yours,
Alex Mulin
VP of business development for X-Cart
X-Payments project manager
Reply With Quote
  #9  
Old 12-26-2014, 08:21 AM
 
MAPerformance Admin MAPerformance Admin is offline
 

Advanced Member
  
Join Date: Jun 2013
Posts: 44
 

Default Re: X-Payments with Google Analytics Conversion Code

I made the suggested change to the code and I'm still not seeing conversion data on the invoice page. Here is my changed code:

Code:
$smarty->assign('orders', $orders); //Commented out $smarty->assign('ga_track_commerce', $ga_track_commerce); $ga_track_commerce = 'Y'; //Change from 'N' to 'Y' based on http://forum.x-cart.com/showpost.php?p=357851&postcount=3 (12/22/2014) $smarty->assign("ga_async_commerce", $ga_async_commerce); $ga_async_commerce = "N";

I had tried changing the Async part to 'Y' as well but it did not help, and I changed it back because it wasn't mentioned here originally. Any other ideas?
__________________
X-cart 4.4.3 Gold
Modern Automotive Performance
Reply With Quote
  #10  
Old 12-29-2014, 08:22 AM
 
MAPerformance Admin MAPerformance Admin is offline
 

Advanced Member
  
Join Date: Jun 2013
Posts: 44
 

Default Re: X-Payments with Google Analytics Conversion Code

Bump for a response. Qualiteam has nothing to offer at this time aside from linking to this thread. We need to get our Analytics in check... please help!

EDIT: Another issue we've run into is our post-purchase emails sent from Bazaarvoice to solicit reviews on items purchased have dropped dramatically since enabling X-Payments. I imagine it's similar to the Google Analytics issue. There seems to be something about XP purchases that is preventing conversion data from being passed to our code on the order confirmation page. Does our code have to be altered to work properly with XP, or is XP "broken" and causing the issues. Meaning, does the fix have to go inside XP code?
__________________
X-cart 4.4.3 Gold
Modern Automotive Performance
Reply With Quote
Reply
   X-Cart forums > X-Payments > X-Payments issues & questions


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:17 AM.

   

 
X-Cart forums © 2001-2018