Google Analytics 4 and HikaShop Google Analytics plugin

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

But how universal analytics plugin works and registers all purchases. It is working diferent from GA4?
Our checkout configuration stay the same after instaling GA4. We are using paypal, credit card payments.
From universal analytics plugin experience I guess purchases is registering not by event it registered by "status" of order confirmation...
With universal plugin registers even internaly/manually created and confirmed orders.

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

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

Hi,

It's indeed working differently.
When the payment gateway notifies your server that the payment is made the payment plugin will change the status of the order from "created" to "confirmed". The Universal Analytics plugin will plug itself on the onAfterOrderUpdate event which will be triggered at that time and send a cURL request to GA's Universal Analytics API with the informations of the order.
This is not possible with GA4 as there is no API to be able to send a cURL request from your server to GA.

So there is only the other method to send the order information:
when the customer comes back from the payment gateway, the javascript of the plugin will be added on the page with the order information.
This second method is implemented in both plugins, but it will only work if the thank you page is HikaShop's thank you page, and only if the user is redirected back to the shop after the payment. If you just close the tab of the payment gateway after the payment and aren't redirected back to the shop automatically or by pressing the "go back to the shop" button there, then the plugin won't be able to send the order information.
So that's why I was asking about payment plugins in my previous message.
So things you can check:
- make sure you activated the option to automatically forward the user back to the shop after the payment in the settings of your PayPal account.
- if that still doesn't help, make sure that the "return URL" setting of the PayPal payment method is empty in the settings of the payment method.
Also, this means that if you manually change the status of the order in the backend, it won't be taken into account as it can only be taken into account from the frontend, through the browser of the customer.
Unfortunately, there is nothing we can do to change that as far as I know. The GA4 API doesn't allow for a cURL request after the order like their previous API and I checked the code of GA4 plugins from other ecommerce solutions and they also only notify the purchase event with the Javascript of the browser of the customer upon return from the payment gateway.

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

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

Yes, there is auto redirection to "thank-you" page after succsessful payment - GA4 plugin do not register purchase event. What is exactly "...HikaShop's thank you page..."?
Also there is credit card payment option, when after successfull payment page link not changing stays at "checkout/task-step/step-2", but writen same text as in "thank-you" page - purchase event also not registering.
Also there is "bank transfer" payment option, that is "confirmed" manually when transfer visible at bank account (status changed manually at backend).
So with new "upgraded" GA4 feels like downgrade from Universal GA...

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

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

Hi,

I looked further into it today, and I can see Google added information about "Measurement Protocol for GA4":
developers.google.com/analytics/devguide...lection/protocol/ga4
This will allow us to do precisely what I was saying was missing for the purchase data.

We'll have to look into it to add that capability to the GA4 plugin. It's a big work so I can't provide anything yet, but I'll work on it.

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

  • Posts: 238
  • Thank you received: 21
  • Hikamarket Multivendor Hikashop Business Hikashop Essential
2 years 2 months ago #344651

Out of curiosity, is the purchase data for G4 been implemented yet?

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

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

I've worked on it but it's not ready yet as I didn't had the time to move forward during summer holidays.
I hope to be able to finish it in October.

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

  • Posts: 238
  • Thank you received: 21
  • Hikamarket Multivendor Hikashop Business Hikashop Essential
2 years 3 weeks ago #346102

The current package file with dates September 2022 is throwing the following error upon installation:

JInstaller: :Install: File does not exist [ROOT][TMP]/install_635bd42a106fc/vendor
Plugin Update: Could not copy files from the source.
danger
Error installing plugin

Nothing gets installed.

Fortunately, I have the prior version (1.0.1 from June 2022) but not sure what if anything, has been updated.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 3 weeks ago #346107

Hi,

Thanks for the feedback. We made a mistake in the XML file of the latest version of the GA4 plugin.
I've uploaded a fixed version right now.

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

  • Posts: 238
  • Thank you received: 21
  • Hikamarket Multivendor Hikashop Business Hikashop Essential
2 years 1 week ago #346551

I downloaded the plugin to install yesterday on a newly upgraded HikaShop 4.6.2 timestamp of Nov. 11, 2022.

However, version # was still 1.0.1.

It adds a new API field (which I added), but it throws a 404 error when you get to confirmation:

0 Failed opening required 'xxxxxxxxx/plugins/system/hikashop_ga4/vendor/autoload.php' (include_path='.:/usr/share/php')

Payment still goes through, but it stopped many of the confirmation step processes (sending emails, recording payment from Authorize.net and PayPal, etc).

autoload.php isn't in the zip file, but the vendor folder is, so it looks like something is missing from the download.

I re-uploaded an older zip file I have from with June 13, 2022 timestamps, and works fine again.

Last edit: 2 years 1 week ago by jazzmang. Reason: added rolled back to the previous version

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 1 week ago #346582

Hi,

My bad. I had forgotten to remove some pieces that I had added for the measurement protocol in the stable package. I've updated the package. It should be better now.

The following user(s) said Thank You: jazzmang

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

  • Posts: 238
  • Thank you received: 21
  • Hikamarket Multivendor Hikashop Business Hikashop Essential
2 years 1 week ago #346599

No error now, thanks.

Is there a change log?

Not sure what the measurement protocol is doing.

Last edit: 2 years 1 week ago by jazzmang.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 6 days ago #346601

Hi,

No changelog yet. Also, it was not supposed to be in there in the first place.
However, we're currently working on adding changelogs to the different plugins on our marketplace. We've already done it for a few and we'll do it for more of them, little by little, when we release new versions of the plugins.

The measurement protocol is an API from GA to send the order data once the order is paid from the server side (while all the rest of the data is sent via javascript by the browser of the user). It's useful to get accurate conversion data, especially for bank transfers, and payment methods where the users can potentially not come back to the thank you page, and thus his order might not be taken into account. I've been working on it this summer, but I hit a snag with PHP 8 and the PHP SDK from GA. I would have to setup a new wamp on my localhost to be able to move forward with it and release the new version with the measurement protocol properly working.

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

  • Posts: 303
  • Thank you received: 18
1 year 11 months ago #347360

Has the purchase data for GA4 been implemented in the plugin yet? There was mention of expected completion in October, but I don't see any indication of updates to the plugin from changelog.

Last edit: 1 year 11 months ago by mojooutdoors-holden.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 11 months ago #347362

Hi,

The purchase data for GA4 was already in the plugin on the first day of its release through the JS SDK GA4 provides. This data is sent to GA when the user comes back to the thank you page of the website.
What has not yet been implemented in the plugin is the measurement protocol API to be able to send that data through a server-to-server communication so that even if the user doesn't come back to the thank you page for some reason, it is still taken into account.
This has not moved forward yet.

The following user(s) said Thank You: mojooutdoors-holden

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

  • Posts: 303
  • Thank you received: 18
1 year 11 months ago #347383

Ah, i see. Then it should work fine with the older paypal plugin (assuming the user is redirected back to the website). Thank you!

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 11 months ago #347386

That's correct.

The following user(s) said Thank You: mojooutdoors-holden

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

  • Posts: 19
  • Thank you received: 3
1 year 5 months ago #352047

Hi,

Just wanted to check if there are plans to implement server-side communication with Google Analytics 4 before July 1st, when it's the cutoff date for universal analytics?

We are still capturing only about 50% of the revenue because users do not go back to the thank you page after purchase.

Thanks.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 5 months ago #352054

Hi,

Actually, server side communication with Google Analytics 4 was added to the GA4 plugin available on our marketplace a few months ago. If you already have the plugin, you need to download it again and install it again on your website to get the latest version.
You'll see a "measurement ID" setting in the plugin settings page which will allow you to activate this capability.

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

  • Posts: 3
  • Thank you received: 1
1 year 5 months ago #352058

Hi Nicolas,

Are you referring to this plugin?
www.hikashop.com/marketplace/product/108...egration-google.html

It shows the last date of modification back in april 2022. And I checked we already have it installed with the 'measurement id' field, but still receiving 50% dropout.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 5 months ago #352060

Hi,

The date there was not up to date. I've improved that page. Thanks for the feedback.
So make sure to download again the plugin and install it again so that you have the latest version.

Also, did you fill the measurement id field with the corresponding information from your GA4 account ? Otherwise, the server-to-server communication won't be done.
Also, the plugin will send the order information when the order is being confirmed (based on the enabled statuses in the System>Order statuses menu). So based on how you configured your statuses and your payment methods, it's possible that the plugin dismiss the communication because the order doesn't go into a valid status for that to happen.

Last edit: 1 year 5 months ago by nicolas.

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

Time to create page: 0.117 seconds
Powered by Kunena Forum