Open navigation

Conversion Tracking using Frontend JavaScript

This feature is available from version(s) 2.10.0 / 3.2.0 of the Klevu plugin in all supported Magento versions and editions.

In addition to server-side synchronization of order data, you can enable a small JavaScript variable on your checkout success page which is used by the core Klevu JavaScript library to send order conversion data in real time.

To enable this feature, you must ensure that the JS library is included on your front end (either via the Stores > Configuration > Klevu > General Settings > Enable on Frontend configuration value or by including the Core JS script manually in your theme).

Then, navigate to Stores > Configuration > Klevu > Metadata Settings and enable both the Metadata and Sync Successful Orders settings. This setting is configurable at store scope, so you can enable it just for select stores.

Finally, clear your Magento cache.

Once done, order data will start sending automatically when customers complete orders on your website.

Compatibility with Server-Side Order Sync

If you have enabled server-side order sync via Stores > Configuration > Klevu > Data Sync Settings > Enable Order Sync, orders sent from the frontend will also be queued and sent via existing sync methods (eg cron jobs or manually using CLI commands).

Duplicate order data received by Klevu will not be included in your conversion tracking statistics, so both methods can be enabled simultaneously.

Limitations

As with any JavaScript-based tracking, there are factors that will prevent data from being synchronized. In these cases, the Klevu extension will not attempt to resend order data unless server-side order synchronization is also enabled.

Some reasons why frontend order data would not be sent include

  • Your site does not use the standard checkout success route at yourwebsite.com/checkout/onepage/success
  • Your theme has heavily customized the checkout success page
  • The order was placed using Magento’s multishipping option
  • The customer did not return to your checkout success page from an external payment gateway
  • The customer is using browser extensions which block tracking data
  • A JavaScript error occurs on the checkout success page before tracking data can be sent
  • An application error prevents the checkout success page being displayed to the customer after the order is placed

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.