Setono / SyliusAnalyticsPlugin

Use Google Analytics to track visitors, purchases etc. in your Sylius store

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Checkout steps

Jurgen8en opened this issue · comments

Hi,

Thanks for the great Plugin, it worked immediately.
One thing, that I am missing is a guide how to add the checkout steps to google analytics.

'ec:setAction','checkout', {
    'step': 1,
    'option': 'xxx'

Hi @Jurgen8en

I am glad it works and you like it. Did you figure out your question since you closed the issue? :)

Not the best solution, but I just added this on the required pages

<script>gtag('event', 'begin_checkout');</script>
<script>gtag('event', 'checkout_progress', {"checkout_step": 1});</script>
<script>gtag('event', 'checkout_progress', {"checkout_step": 2});</script>
...

I would reopen this issue to be addressed in a proper way. I think I will be able to provide an implementation

Yes, I agree. It should be provided in the plugin

Another thing.
The purchase call should not be added to the thank-you page. It generated duplicates, and some custumers don´t wait this page to be loaded.
gtag('event', 'purchase', {"transaction_id":"...

The purchase should be called by the backoffice:
https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide

if you do the purchase request on server side, you loose all the referral and UTM campaign data. and then all orders will be associated with the direct channel. you don't want that.

Server side:

Closing this issue since we are past this. The new branch (and soon new version) will support GA4 with the relevant events