Google Analytics 4 and HikaShop Google Analytics plugin

  • Posts: 148
  • Thank you received: 21
  • Hikashop Business
2 years 6 months ago #341189

Hi,

I think I have a problem with Google Analytics 4 :

This message contains confidential information


In the "HikaShop Google Analytics plugin", we can set up an account with a format 'UA-XXXXX-X'
If I create a property with the older version (Universal Analytics), the format corresponds.

But with Google Analytics 4, I have a property with this format : XXXXXXXXX

And of course, I have this error probably because I use my account XXXXXXXXX.
I have this error on the checkout page, not on the home or product page for example.

Is this plugin compatible with GA4 and how do I configure it?

Notes :
- I would like to point out that my account seems to be well connected because I'm receiving data from Google Analytics.
- The first warning ( 8 ) is probaly more related to the Mondial Relay plugin.
This message contains confidential information



Thanks in advance for your help.

Last edit: 2 years 6 months ago by FDBI.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 6 months ago #341192

Hi,

The "HikaShop Google Analytics plugin" is NOT compatible with Google Analytics 4.
However, you're in luck.
We released a Google Analytics plugin for Google Analytics 4 a few days ago here:
www.hikashop.com/marketplace/product/108...egration-google.html
So you need to disable the "HikaShop Google Analytics plugin" plugin and install this new one instead. In its settings, you can configure the "Measurement ID" of your GA4 interface and it should work fine.

Last edit: 2 years 6 months ago by nicolas.
The following user(s) said Thank You: oxido, FDBI

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

  • Posts: 148
  • Thank you received: 21
  • Hikashop Business
2 years 6 months ago #341210

HI,

Nice timing !

I'll look into it, thanks.

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

  • Posts: 148
  • Thank you received: 21
  • Hikashop Business
2 years 6 months ago #341233

Hi,

I noticed that my dynamic filters (products listing) no longer work when the 'Hikashop Google Analytics 4 Plugin' is activated (it seems to work again when I deactivate it).

I don't know if there are other problems elsewhere (nor why it causes this problem).

Last edit: 2 years 6 months ago by FDBI.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 6 months ago #341235

Hi,

That's interesting. It could be a bug in the plugin or a conflict with the filtering system. Could you provide the URL of a page with the issue so that we could look into it ?

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

  • Posts: 148
  • Thank you received: 21
  • Hikashop Business
2 years 6 months ago #341270

This message contains confidential information

Last edit: 2 years 6 months ago by FDBI.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 6 months ago #341272

Hi,


When I use the filters on that page, I can see an AJAX request returning with an error 500 (a fatal error):
i.imgur.com/ZC1mB3L.png
However, as the "debug system" setting is not activated in the Joomla configuration, I only see a simplified message "0 Class "JParameter" not found" instead of the full error message, with the file paths where the problem happen.
It would be important to get the full error message to understand what's going on.
Could you try with the debug system setting activated and get the full error message ?
Or if you could provide a backend access, I could do it myself ?

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

  • Posts: 148
  • Thank you received: 21
  • Hikashop Business
2 years 6 months ago #341275

Sorry, system debug is now activated.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 6 months ago #341281

Hi,

Thanks. I've made a new version of the GA4 plugin which should fix the issue.
Please download it again and install it again. It should hopefully fix the issue.

The following user(s) said Thank You: oxido, arunas, FDBI

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

  • Posts: 148
  • Thank you received: 21
  • Hikashop Business
2 years 6 months ago #341285

Hi,

It seems fixed, thanks !

The following user(s) said Thank You: nicolas

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

  • Posts: 10
  • Thank you received: 0
2 years 5 months ago #342645

Looks like new plugin works, but from optimisation side ruins all pagespeed insights result significantly.
Are you going to look into this issue? With old universal analytics plugin was no problems.

Also have question is this GA4 plugin works alone or should be used with Global site tag (gtag.js) simultaneously?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 5 months ago #342653

Hi,

The plugin works alone.
Could you provide more information on the pagespeed issue ?

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

  • Posts: 10
  • Thank you received: 0
2 years 5 months ago #342659

Pagespeed insights identify it as render blocking resource and sugests 1.5 savings if removed or defered:
/gtag/js?id=XXXXXXXXXXXXXXXX ( www.googletagmanager.com ) 69.7 KiB 1,530 ms
As mentioned before with universal analytics plugin there was no issues.

Last edit: 2 years 4 months ago by arunas.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 5 months ago #342672

Hi,

Well, I think there is nothing that can be done for this unfortunately.
That file is Google Analytics 4's javascript file. It is required.
Without it, the plugin is useless and it's not possible to use GA4.

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

  • Posts: 10
  • Thank you received: 0
2 years 5 months ago #342674

But when we are using Analytics 4 Global Tag loading the same javascript file we do not get any pagespeed insights score decrease and no message about render blocking resource. When using hikashop plugin we get the big pagespeed score drop. For global taging we are using this google sugested code:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src=" www.googletagmanager.com/gtag/js?id=XXXXXXXXXXXXXX "></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'XXXXXXXXXXXXXXXXXXXX');
</script>

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 4 months ago #342675

Hi,

I see what you mean.
Try changing the line:

$doc->addScript('https://www.googletagmanager.com/gtag/js?id='.$this->site_id);
to:
$doc->addScript('https://www.googletagmanager.com/gtag/js?id='.$this->site_id, array(), array('async'=>'async'));
in the file plugins/system/hikashop_ga4/hikashop_ga4.php
That should help.
Let us know how it goes so that we can confirm it helps and include it on our end.

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

  • Posts: 10
  • Thank you received: 0
2 years 4 months ago #342740

Yes, problem solved with gtag/js as "render blocking resource", no message about it and no significant score drop.
But still there is gtag/js message about "Reduce unused JavaScript".
/gtag/js?id=XXXXXXXXXXXX ( www.googletagmanager.com ) 69.6 KiB 29.2 KiB

With Hikashop universal analytics plugin or universal taging when loading same gtag/js file there was no such message.
Thank you.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 4 months ago #342747

Hi,

Well, it's apparently a normal result with GA4:
stackoverflow.com/questions/68391231/how...d-to-improve-perfoma

Of course, it would be possible to circumvent this with the code provided on that link. But it's just a way to bypass the pagespeed algorithm.
Because what that code in the link does is that it manually loads the file on the page instead of letting the browser do it. So you don't gain any speed by doing the change. It's even the opposite since you do a tiny bit more processing.
So I don't think we should do the change and that you should just ignore the message.

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

  • Posts: 10
  • Thank you received: 0
2 years 4 months ago #342864

Thank you.

After implementing GA4 there's another problem with the plugin. We do not see any puchases in GA4 analytics.
And same with Universal analytics plugin sales registering perfectly.
On GA4 we see registered following events if it could help to find where to search...
begin_checkout
click
first_visit
page_view
scroll
session_start
view_cart
view_item
view_item_list

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 4 months ago #342868

Hi,

So you mean you're missing the "purchase" event at the end of the checkout.
What payment method are you using on your shop ? And how is it (are they) configured ?

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

Time to create page: 0.115 seconds
Powered by Kunena Forum