For the complete documentation index, see llms.txt. This page is also available as Markdown.

What is the Oddle Shop Tracker?

The Oddle Shop Tracker is a tool for developers who need to fire custom tracking scripts at specific points during the customer ordering journey — for example, sending a conversion event to Google Ads or a third-party affiliate network when a customer completes a purchase.

It works as a middleware layer: you define a set of actions to listen for, conditions under which your code should run, and a callback function to execute. This is injected via a custom script in your shop's marketing settings.

This feature requires some JavaScript knowledge. If you're not a developer, contact support@oddle.me for help setting up custom tracking.


How it works

You configure the tracker by defining an array of objects in window.oddleTracker. Each object has three properties:

Property
Description

actionType

The application event to listen for

condition

A function that returns true if the callback should fire

callback

The function to run when the action and condition are met

Key action types

These are the most commonly used events:

@@route/ROUTE_INIT
@@route/ROUTE_CHANGE_COMPLETE
@@checkout/GET_CHECKOUT_META_SUCCESS
@@order/ADD_TO_CART_SUCCESS
@@user/REGISTER_SUCCESS
@@newsletter/NEWSLETTER_SIGNUP_SUCCESS

Your callback receives an object with two properties:

  • action — contains type and payload of the current event

  • state — the current application state, where you can access order data


How to inject the tracker

Add your tracker script in Online Ordering > Settings > Marketing > Custom Scripts. Place the script in both the Shopping Cart Page body and the Thank You Page head — this ensures it fires correctly whether the customer loads the thank-you page fresh or arrives via in-app navigation.


Examples

Google Ads conversion tracking

Replace TODO: PUT YOUR ID HERE with your Google Ads conversion ID.

Custom purchase tracker

This example uses a third-party conversion library. Replace XXXX with your site ID.

Last updated