- Posts: 165
- Thank you received: 3
google analytics plugin code not tracking correctly.
- jschroeder
-
Topic Author
- Offline
-- Joomla version -- : 2.6.4
Hi, I am having a very weird issue. I attached a screenshot of both my plugin settings as well as the report sales for analytics. There is something very off in the analytics plugin in hikashop. It is reporting equal values for both the revenue and tax column in analytics. However, I don't even have tax on any product in the entire cart currently so, I have no idea how this could be happening?
The total sales that should be showing up currently should be approx. twice what it is right now and tax should be 0.
Can you please help me, this is a major issue?
Please Log in or Create an account to join the conversation.
We've actually added several fixes to the Google Analytics plugin in HikaShop 2.6.4 in order to fix the calculated amounts sent to GA which could be incorrect in some cases.
So you must be in one of these cases.
I would recommend to update to the latest version of HikaShop and the new data which will be sent to GA should be correct. Regarding the data already sent to GA, I'm afraid there is nothing that can be done.
Please Log in or Create an account to join the conversation.
- jschroeder
-
Topic Author
- Offline
- Posts: 165
- Thank you received: 3
Thanks,
Josh
Please Log in or Create an account to join the conversation.
What you can do then is download the 2.6.4 install package, get the google analytics plugin files from the folder back/extensions in the install package, zip them and install them on your website. It should work fine with the 2.6.3 and it will contain the fixes for the calculations.
Please Log in or Create an account to join the conversation.
- PolishedGeek
-
- Offline
- Official HikaShop Development Partner
Also - where can we download the last official v2.6.4, with all patches? Under the account we only see v 3.x of course.
~ Deb Cinkus, CEO
Polished Geek: more with monday․com
eCommerce Business Process Automation Experts
Please Log in or Create an account to join the conversation.
Yes. We've made a fix patches since then.
I would recommend using the one from HikaShop 3's install package. It will work with the 2.6.4 but will contain all the latest patches.
Please Log in or Create an account to join the conversation.
- PolishedGeek
-
- Offline
- Official HikaShop Development Partner
We looked at only new orders placed a day after the code was updated, to make sure we were testing against the newest code.
I'm attaching a copy of our configuration settings. We are using direct call, single submission.
1) When comparing the numbers in Google vs. the HikaShop orders, most transactions are showing up DOUBLED in Google for number of transactions, revenue and product sales. This is happening on almost every new order.
2) When a confirmed order is CANCELLED, it is added to the Google Analytics stats again instead of reversed. Cancelling an order ads the revenue again, increases the transaction count and increases the sales revenue for the products on the order. It should be reversing those stats, not increasing them, when an order is marked as Refunded or Cancelled.
~ Deb Cinkus, CEO
Polished Geek: more with monday․com
eCommerce Business Process Automation Experts
Please Log in or Create an account to join the conversation.
The "single submission" algorithm is based on the HikaShop invoice order statuses setting.
Thus, the first time the order will be confirmed (so the order do not have an "order_invoice_id") the submission will be made.
I don't see any code which allow the plugin to record a cancelled order, nor code to handle that specific order status to send a negative value.
And due to the "single submission" setting, I don't even know how it could be possible to not submit several time a cancelled order... (but I first don't understand how a cancel order can be submitted)
So I think we would need more details about your order statuses configuration.
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.
- PolishedGeek
-
- Offline
- Official HikaShop Development Partner
Thanks for the reply over the weekend. I've retested and think that I've narrowed down that the cancellation didn't trigger additional analytics, I cancelled it almost immediately after doing the test and the duplication was not immediate, leading me to believe that the cancellation caused it.
Attached are some screenshots, including the order status settings.
Double entries are definitely happening in the analytics. Everything is being recorded exactly twice as much as it should be.
Google Analytics for today, before my test order
My test order information
Google Analytics doubled
~ Deb Cinkus, CEO
Polished Geek: more with monday․com
eCommerce Business Process Automation Experts
Please Log in or Create an account to join the conversation.
I see that you're using not using HikaShop 3.0, so I don't know what version of the plugin you have exactly.
Because your order is created "confirmed", there is just one trigger called. So I don't understand how you can have two transaction on one single trigger.
So it would mean that you also have a call made via the trigger "onAfterRender", which looks weird because the session should not contain the information..
So I would recommend to change the function "googleProcess" to add a new parameter
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.
- PolishedGeek
-
- Offline
- Official HikaShop Development Partner
Will give your suggestions a try - thanks!
~ Deb Cinkus, CEO
Polished Geek: more with monday․com
eCommerce Business Process Automation Experts
Please Log in or Create an account to join the conversation.
- PolishedGeek
-
- Offline
- Official HikaShop Development Partner
We updated the code as suggested and installed it a few hours ago. The client has had multiple orders since the new code was installed and now the numbers being reported to Google are exactly right!
I hope you will put this code into the standard plugin. It definitely solved the problem of double counted orders in GA.
Thanks!
~ Deb Cinkus, CEO
Polished Geek: more with monday․com
eCommerce Business Process Automation Experts
Please Log in or Create an account to join the conversation.
It's commit.
I still don't understand why you got that glitch because the "display_ga" variable in the session is reset to 0 when the "direct call" is made, but I commit the patch.
So it will be included in the next release.
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.
nicolas wrote: Hi,
Yes. We've made a fix patches since then.
I would recommend using the one from HikaShop 3's install package. It will work with the 2.6.4 but will contain all the latest patches.
Hi Nicolas - I'd like to try the same fix.
Which files should be used please? Those from /administrator/components/com_hikashop/extensions/plg_system_hikashopanalytics ?
And do I just replace those (2.6.1) files with those from 3.0.1 ? Or are there any other steps involved...
Please Log in or Create an account to join the conversation.
The Joomla plugins are installed in the "plugins" folder of Joomla.
The "extensions" folder under HikaShop is just there to allow HikaShop to install or reinstall his plugins.
And yes, you can just replace the files in the plugin folder with the ones from the install package.
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.
- PolishedGeek
-
- Offline
- Official HikaShop Development Partner
~ Deb Cinkus, CEO
Polished Geek: more with monday․com
eCommerce Business Process Automation Experts
Please Log in or Create an account to join the conversation.
The patch has been added in the plugin last month but with slightly differences than the one I proposed here.
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.
- PolishedGeek
-
- Offline
- Official HikaShop Development Partner
Google Tag Manager can be set up with the GA code to feed analytics data to Google, so when done properly will it work with your ecommerce tracking plugin or do you have to stick to just GA on the site?
~ Deb Cinkus, CEO
Polished Geek: more with monday․com
eCommerce Business Process Automation Experts
Please Log in or Create an account to join the conversation.
We didn't test it with Google Tag Manager.
So I don't know if it can work with it or not.
The subject www.hikashop.com/forum/checkout/890197-a...-before-payment.html seems to indicate that something is missing but I don't know if that's normal or if it's specific to that person due to the way the shop is configured. More information will be needed.
Please Log in or Create an account to join the conversation.