Analytics missing on last checkout page before payment

  • Posts: 88
  • Thank you received: 19
7 years 6 months ago #269271

-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.7

Hi

I'm trying to debug an issue, that all conversion are marked as source = direct in google analytics. This is a huge problem, as we can't see where the conversions are coming from.

During the debug process, I used Google Tag Assistant for Chrome, to record what tags are loaded on the pages.

Normally we load Analytics through Google Tag Manager, but I also tested by loading analytics directly in the template file, with identical results.

What I found is, on the last page e.g. /products/checkout/task-step/step-2 where the page redirects to the payment provider, analytics is not loaded.

Analytics is loaded again on PayPal/payment provider page, and when user is returned, but I'm thinking that the missing tag on /step-2 could result in the conversion source being direct. What do you think?

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 6 months ago #269335

Hi,

I'll be happy to help, but as I've never used Google Tag Assistant or Google Tag Manager, I'm missing context here.

First, the way the customer is redirected to the payment gateway depends on the payment gateway.
Which one did you try ?
If you use bank transfer, does it work properly ?

I suppose that the problem is that the javascript of the payment method to redirect to the payment gateway is run before Google Analytics had the time to run on the page. In that case, the modification is to be done in the end file of the payment plugin in order to add a delay to the redirection javascript.

Please Log in or Create an account to join the conversation.

  • Posts: 88
  • Thank you received: 19
7 years 6 months ago #269607

Hi again

After some more testing, and realtime tracking in Google Analytics, I can follow a user from e.g. Facebook, all the way through the checkout and to the thank you page, while keeping the referral. So the issue is not missing tracking, or a broken session during checkout.

Then I started looking into the data from Google Analytics. There I found that all the conversions had HikaShopAnalyticsTracking as browser. So it seems that "something" is broken in what Hikashop Google Analytics Plugin is reporting back to Google Analytics?

What do you think?

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 88
  • Thank you received: 19
7 years 6 months ago #269610

Another thing: In line 378 in hikashopanalytics.php you have a preg_match with a regular expression that doesn't seem to catch a case where the analytics id ends with e.g. -11 (double digit) - we have such a case for one of our currencies.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 6 months ago #269615

Hi,

The fact that you have HikaShopAnalyticsTracking indicates that in the settings of the plugin, you have activated the direct call setting. In that case, the plugin will directly contact Google Analytics to send the data of the order, without any javascript involved.
So it explains why you're loosing the tracking since the tracking is done with the javascript.

Regarding the regex, I've never heard of these having double digits at the end.
Even Google references it has having only one digit at the end: developers.google.com/analytics/devguide...lection/analyticsjs/
But ok, we can modify the regex for the next version to allow 2 digits.

Please Log in or Create an account to join the conversation.

  • Posts: 88
  • Thank you received: 19
7 years 6 months ago #269761

I actually changed that (set direct call to no) 2 days ago, and checked today. Still, all conversion are from HikaShopAnalyticsTracking browser. Please see attached. The screenshot from Google Analytics is for conversion from today, so not old data here.

Also, I'm failing to see the ecommerce javascript after I set direct call to no - at hvad page should it be added? I would expect it at the thank you page?

Attachments:
Last edit: 7 years 6 months ago by dyvel.

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 6 months ago #269778

Hello,

You are using Paypal as paiement method right ?

Nicolas wrote :

The fact that you have HikaShopAnalyticsTracking indicates that in the settings of the plugin, you have activated the direct call setting. In that case, the plugin will directly contact Google Analytics to send the data of the order, without any javascript involved.
So it explains why you're loosing the tracking since the tracking is done with the javascript.


And he is right ; but he forgot to mentioned that, when an order is confirmed by "server-to-server" notification ; the Direct Call is also used in order to not loose any track.
Before ; the real big issue and the main reason why we have the "direct call" is that a customer do not always come back in the store to have the special Analytics JS and track his sale.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.057 seconds
Powered by Kunena Forum