[Skip to main content](#vessel-content)

#   Analytics missing on last checkout page before payment

##

- **[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")**
- [![dyvel's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39996-dyvel "View dyvel's Profile") Topic Author
- [ Offline](/forum/user/39996-dyvel)

Less More

- Posts: 88
- Thank you received: 20
-
-

9 years 6 months ago [\#269271](#269271) by [dyvel](/forum/user/39996-dyvel "View dyvel's Profile")  *[Analytics missing on last checkout page before payment](/forum/27-checkout/890197-analytics-missing-on-last-checkout-page-before-payment#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?")* was created by *[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")*

-- 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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg5MDE5Ny1hbmFseXRpY3MtbWlzc2luZy1vbi1sYXN0LWNoZWNrb3V0LXBhZ2UtYmVmb3JlLXBheW1lbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

9 years 6 months ago [\#269335](#269335) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Analytics missing on last checkout page before payment](/forum/27-checkout/890197-analytics-missing-on-last-checkout-page-before-payment#269335 "-- 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?")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg5MDE5Ny1hbmFseXRpY3MtbWlzc2luZy1vbi1sYXN0LWNoZWNrb3V0LXBhZ2UtYmVmb3JlLXBheW1lbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")**
- [![dyvel's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39996-dyvel "View dyvel's Profile") Topic Author
- [ Offline](/forum/user/39996-dyvel)

Less More

- Posts: 88
- Thank you received: 20
-
-

9 years 6 months ago [\#269607](#269607) by [dyvel](/forum/user/39996-dyvel "View dyvel's Profile")  Replied by *[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")* on topic *[Analytics missing on last checkout page before payment](/forum/27-checkout/890197-analytics-missing-on-last-checkout-page-before-payment#269607 "-- 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?")*

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?

- [ ![Skrmbillede2017-05-16kl.11.27.05.png](/forum/attachment/38142) ](/forum/attachment/38142 "...l.11.27.05.png") [ ](/forum/attachment/38142?download=1 "...l.11.27.05.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg5MDE5Ny1hbmFseXRpY3MtbWlzc2luZy1vbi1sYXN0LWNoZWNrb3V0LXBhZ2UtYmVmb3JlLXBheW1lbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")**
- [![dyvel's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39996-dyvel "View dyvel's Profile") Topic Author
- [ Offline](/forum/user/39996-dyvel)

Less More

- Posts: 88
- Thank you received: 20
-
-

9 years 6 months ago [\#269610](#269610) by [dyvel](/forum/user/39996-dyvel "View dyvel's Profile")  Replied by *[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")* on topic *[Analytics missing on last checkout page before payment](/forum/27-checkout/890197-analytics-missing-on-last-checkout-page-before-payment#269610 "-- 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?")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg5MDE5Ny1hbmFseXRpY3MtbWlzc2luZy1vbi1sYXN0LWNoZWNrb3V0LXBhZ2UtYmVmb3JlLXBheW1lbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

9 years 6 months ago [\#269615](#269615) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Analytics missing on last checkout page before payment](/forum/27-checkout/890197-analytics-missing-on-last-checkout-page-before-payment#269615 "-- 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?")*

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/](https://developers.google.com/analytics/devguides/collection/analyticsjs/)
But ok, we can modify the regex for the next version to allow 2 digits.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg5MDE5Ny1hbmFseXRpY3MtbWlzc2luZy1vbi1sYXN0LWNoZWNrb3V0LXBhZ2UtYmVmb3JlLXBheW1lbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")**
- [![dyvel's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39996-dyvel "View dyvel's Profile") Topic Author
- [ Offline](/forum/user/39996-dyvel)

Less More

- Posts: 88
- Thank you received: 20
-
-

9 years 6 months ago -  9 years 6 months ago [\#269761](#269761) by [dyvel](/forum/user/39996-dyvel "View dyvel's Profile")  Replied by *[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")* on topic *[Analytics missing on last checkout page before payment](/forum/27-checkout/890197-analytics-missing-on-last-checkout-page-before-payment#269761 "-- 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?")*

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?

- [ ![Skrmbillede2017-05-18kl.11.14.16.png](/forum/attachment/38169) ](/forum/attachment/38169 "...l.11.14.16.png") [ ](/forum/attachment/38169?download=1 "...l.11.14.16.png")
- [ ![Skrmbillede2017-05-18kl.11.13.51.png](/forum/attachment/38170) ](/forum/attachment/38170 "...l.11.13.51.png") [ ](/forum/attachment/38170?download=1 "...l.11.13.51.png")

Last edit: 9 years 6 months ago by [dyvel](/forum/user/39996-dyvel "View dyvel's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg5MDE5Ny1hbmFseXRpY3MtbWlzc2luZy1vbi1sYXN0LWNoZWNrb3V0LXBhZ2UtYmVmb3JlLXBheW1lbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 6 months ago [\#269778](#269778) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Analytics missing on last checkout page before payment](/forum/27-checkout/890197-analytics-missing-on-last-checkout-page-before-payment#269778 "-- 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?")*

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 &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg5MDE5Ny1hbmFseXRpY3MtbWlzc2luZy1vbi1sYXN0LWNoZWNrb3V0LXBhZ2UtYmVmb3JlLXBheW1lbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.064 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
