stefandoorn / sylius-google-tag-manager-enhanced-ecommerce-plugin

Enhanced Ecommerce implementation through Google Tag Manager for Sylius eCommerce Platform
MIT License
35 stars 19 forks source link

Purchase sent to GA even for not paid order #143

Closed LucaGallinari closed 2 years ago

LucaGallinari commented 2 years ago

Is it correct to push to GA all orders, even those that are not paid? The "purchase" event is, actually, fired when the user lands on the thank you page, without checking the state of the payment for the order. Maybe the payment failed but the order has already been created so the user land on the thank you page, and then he can retry the payment from the my account.

stefandoorn commented 2 years ago

I think by default failed payments end up in the checkout again, not on the confirmation page. I'm not aware that changed in recent Sylius versions. In my case only properly paid orders end on the confirmation page + the ones that choose for bank transfer. That's I think a quite ok logic.

But, that being said, the event listener that triggers the adding of the data can be adjusted and overriden to adjust to your business need of course.

LucaGallinari commented 2 years ago

Hi Stefan, thank you for the fast reply.

I think by default failed payments end up in the checkout again, not on the confirmation page. I'm not aware that changed in recent Sylius versions.

Yeah, you are right, the fact that the user lands on the thank you page its a customization. I didn't remember

In my case only properly paid orders end on the confirmation page + the ones that choose for bank transfer. That's I think a quite ok logic. But, that being said, the event listener that triggers the adding of the data can be adjusted and overriden to adjust to your business need of course.

Of course for the override👍🏻. I just wanted to know your opinion on this behaviour.

Thanks!