Hikashop Analytics not firing Transaction data for guest orders

  • Posts: 9
  • Thank you received: 0
5 years 1 month ago #311623

-- HikaShop version -- : 4.2.1
-- Joomla version -- : 3.9.12
-- PHP version -- : 7.3.10
-- Browser(s) name and version -- : Google Chrome 77
-- Error-message(debug-mod must be tuned on) -- : None

The webshop allows customers to purchase without registration.
All runs fine, except for the Transaction data in Google Analytics. Orders created and completed by 'guests' are not send to Analytics, all other orders are...

Please help us out.

Kind regards,
Olaf

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 1 month ago #311626

Hi,

Could you provide a screenshot of the settings of your HikaShop google analytics plugin ? (you can hide the account data on the screenshot)

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

  • Posts: 9
  • Thank you received: 0
5 years 1 month ago #311665

Hi Nicholas,

Yes, attached!
Please note that all non-guest orders are working fine and are correctly sent to Analytics.

Regards,
Olaf

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 1 month ago #311672

Hi,

I would recommend to activate the "force universal analytics" setting of the plugin and see if that helps.

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

  • Posts: 9
  • Thank you received: 0
5 years 1 month ago #311919

Hi Nicholas,

With Universal Analytics all orders do appear in Google Analuytics. However, the product data is not visible in Analytics.

This is an example of the code generated:

<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,"script","//www.google-analytics.com/analytics.js","ga");

ga("create", "UA-xxxxxx", "auto"); // Removed for security reasons
ga("require", "displayfeatures");
ga("require", "linkid", "linkid.js");
ga("send", "pageview");
ga("require", "ecommerce", "ecommerce.js");

ga("ecommerce:addTransaction", {
	"id": "30001554",
	"affiliation": "Hartog",
	"revenue": "37.62",
	"shipping": "6.4",
	"tax": "2.46",
	"currency: "EUR"
});

ga("ecommerce:addItem", {
	"id": "30001554",
	"name": "Luzernepellets",
	"sku": "LPZ",
	"category": "",
	"price": "15.60826",
	"quantity": "2"
});

ga("ecommerce:send");
</script>
<!-- End Google Analytics -->

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 1 month ago #311951

Hi,

With "Universal Analytics", HikaShop sends a cURL request to Google when the order status is changed, so you're guaranteed to have the request sent to Google.
However, it uses another API than the javascript API (so it doesn't use the code that you posted in your message), as it's not possible.
And that other API doesn't allow the plugin to send the product data.
Without the "Universal Analytics", then HikaShop sends the data via the javascript API, but this requires the customer to comes back to your website after the payment.
If the customer closes the tab after the payment on the payment gateway, then the javascript API cannot be used in the browser of the customer and thus the data is not sent to Google Analytics.
Not much we can do to help in either case I'm afraid.
What you could do though is make sure that the customers are automatically redirected back to your website after the payment. Some payment gateways have an option you can activate in the merchant account for that.

Last edit: 5 years 1 month ago by nicolas.

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

Time to create page: 0.070 seconds
Powered by Kunena Forum