PrestaShop / ganalytics

Gain clear insights into important metrics about your customers, using Google Analytics in PrestaShop 1.6.
11 stars 43 forks source link

[-] MO ganalytics Fixes 78 checkout steps not being sent to google Analytics #89

Closed pierreavizou closed 8 years ago

pierreavizou commented 8 years ago

Google Analytics ecommerce data has to be sent along with a hit, like pageview or event. However, for some reason, the pageview hit inserted in a separate <script> tag (in _getGoogleAnalyticsTag()) is often sent before the ecommerce data is set, resulting in no checkout steps being sent.

Since checkout steps do not send an event hit type in the JS lib, we need to send a pageview hit right after setting the ecommerce data. We also set $js-state to 1 in the hookFooter for checkout pages so that there is no duplicate pageview sent to Google Analytics.