gtm4wp icon indicating copy to clipboard operation
gtm4wp copied to clipboard

Problem with the "purchase" event

Open atoupet-toki opened this issue 1 year ago • 17 comments

Hello! We have a problem with the "purchase" event. Wordpress and all plugins are updated. We have also tested gtm4wp version 1.20-beta.2. We also followed the tutorials to setup the plugins and the GTM (New empty container, and importing the json container from the tutorial).

We have all events in dataLayer, except "purchase". We've debugged the plugin code, and it seems that the $order->update_meta_data functions are called before the purchase_datalayer. If we comment out the 2 lines $order->update_meta_data( '_ga_tracked', 1 ); it works. But we can see that .... the 2 lines are after the purchase_datalayer.

We are using Complianz plugin for cookies. But same probleme without this plugin Has anyone submitted a similar request? Do you need more information to test and validate something? Please let me know.

Thanks in advance

Here is capture of datalayer: Capture d’écran, le 2024-01-30 à 11 34 39

atoupet-toki avatar Jan 30 '24 16:01 atoupet-toki

Hi,

In similar cases there was some sort of payment processing plugin that abnormally executed codes normally run once during generating the order received page but in the background. Therefore when the order received page was really loaded, the order was already set to be tracked once.

duracelltomi avatar Jan 31 '24 14:01 duracelltomi

Hi, im dealing with the same issue, using default woocommerce checkout and payment processing options, but I have no clue now what exactly happening there,

is there any possible solution?

takibulislam avatar Feb 12 '24 03:02 takibulislam

@takibulislam do you have a testing/sandbox/dev version of your site where I can place an order without the need to actually pay for the products?

duracelltomi avatar Feb 12 '24 05:02 duracelltomi

Hi @duracelltomi im not a web developer for this website, but I can get a 100% discount code with free shipping so you can avoid paying anything, do you think It will work?

takibulislam avatar Feb 12 '24 05:02 takibulislam

@duracelltomi
i think the info i have provided was incorrect, here is the payment configuration of our website. image

this is the replay I'v got from the Dev team,

  • it is using Afterpay Gateway for WooCommerce and Square
  • and PayPal Gateway By Payment Plugins

please let me know if you need anything else, appreciate your help

takibulislam avatar Feb 12 '24 06:02 takibulislam

Is it working if you select the direct bank transfer during checkout?

duracelltomi avatar Feb 12 '24 06:02 duracelltomi

image I have just placed an order with Direct Bank transfer, it's not working, unfortunately.

I can provide you with a duplicate version of our website, if you want please let me know how can I send you the info

takibulislam avatar Feb 12 '24 06:02 takibulislam

@duracelltomi Hello, we have created a test version of our website, if you want to test I can send you the information. please let me know,

Thank you.

takibulislam avatar Feb 13 '24 09:02 takibulislam

Please send details to messenger at gtm4wp dot com. Thanks!

duracelltomi avatar Feb 13 '24 10:02 duracelltomi

@duracelltomi I have sent login info to the email you mentioned. I would love to know if there is any update on it.

seems like many people facing the same issue nowadays, hope it will be resolved for all of us.

Thanks for your support and waiting for your response!

takibulislam avatar Feb 14 '24 03:02 takibulislam

I received your message. I have a tough day today, it can happen that I will only be able to deep dive tomorrow

duracelltomi avatar Feb 14 '24 08:02 duracelltomi

OK, I was just too curious :-) When I turn on the following GTM4WP option: 'do not flag orders as being tracked' - the purchase event is there.

It means that for any reason, another plugin is calling codes normally executing while showing the user the order confirmation page. GTM4WP flags the order as being tracked once and when the real order received page is shown, no purhcase event is fired since GTM4WP "sees" that it was already tracked once.

duracelltomi avatar Feb 14 '24 08:02 duracelltomi

This is exactly the same problem I mentioned, but it doesn't seem to me to be related to a payment processing plugin, we don't have the same @takibulislam and me.

atoupet-toki avatar Feb 14 '24 12:02 atoupet-toki

@atoupet-toki In my case I also feel like payment processing isn't responsible, I have tried turning off that plugin but still faced the same issue. but I'm not 100% sure.

but anyway I hope Thomas will be able to figure out a decent solution for us.

takibulislam avatar Feb 14 '24 15:02 takibulislam

I just want to let you know that I am committed finding a solution to this situation but I have limited time to investigate. I do my best to find a solution as soon as possible.

duracelltomi avatar Feb 16 '24 09:02 duracelltomi

hey @duracelltomi ! Have you found anything to fix the bug? @takibulislam Do you still have the problem?

atoupet-toki avatar Feb 27 '24 17:02 atoupet-toki

Hi,

No yet but I had an extremely busy week behind me, most probably I will have time to continue with the investigation next week.

duracelltomi avatar Feb 28 '24 15:02 duracelltomi