Direct Offer Conversion Tracking (OmniSDK + Google Tag Manager)
This guide walks you through setting up conversion tracking with MomentScience using Google Tag Manager (GTM).
Before you begin, ensure you have:
- Your MomentScience account IDο»Ώ
- Your landing page URLs
- Your conversion page URLs
To ensure MomentScience tracking works across all pages, you need to create a Data Layer Variable for your account ID.
- In Google Tag Manager, navigate to Variables.
- Create a new variable of type Data Layer Variable.
- Name it accountId.
- Check "Set Default Value" and enter your MomentScience account ID as the default.
π This ensures your account ID is accessible throughout your GTM setup.

The MomentScience OmniSDK is required for tracking user interactions and conversions.
- In GTM, go to Tags and create a new tag of type Custom HTML.
- In the HTML field, enter the following:ο»Ώ
- Set the trigger to fire on all pages.
- Save and publish your changes.
β This ensures that the OmniSDK is loaded on every page of your site for tracking purposes.

- In GTM, create another tag of type Custom HTML.
- Enter the following code:ο»Ώ
- Set the tag firing option to Once per page.
- Under Tag Sequencing, select "Fire tag before..." and choose the OmniSDK tag from Step 2.
- Under Triggers, configure the tag to fire only on landing pages.
π This tag ensures that click IDs are properly captured for attribution.
This step will guide you through setting up a Custom HTML Tag in GTM that fires only on pages where you want to track conversion events (e.g., purchases, signups, or registrations).
Before configuring the tag, we need to define two Data Layer Variables to hold:
- The event name (e.g., conversion, purchase, lead).
- The event value (e.g., the transaction amount).
ο»Ώ

Steps to Create Data Layer Variables
- In Google Tag Manager (GTM), go to Variables β New.
- Create a Data Layer Variable with the following settings:
- Variable Name: eventName
- Set Default Value: "conversion"
- Create another Data Layer Variable:
- Variable Name: amount
- Set Default Value: 0
When youβre done, you should have 3 user-defined variables of type Data Layer.
π Ensure these variables exist before proceeding to the next step.
- In GTM, go to Tags and create a new tag of type Custom HTML.
- Enter the following JavaScript code:ο»Ώ
- Set the tag firing option to Once per page.
- Under Tag Sequencing, select "Fire tag before..." and choose the OmniSDK tag you set up in Step 2.
- Under Triggers, configure the tag to fire only on conversion pages.
π This script tracks conversions by capturing stored click IDs and sending them back to MomentScience.
To ensure Google Tag Manager (GTM) can correctly track conversions, you must pass Data Layer Variables on your siteβs pages. This section explains how to include these variables in your websiteβs <head> section.
On all landing pages, insert the following code above your GTM implementation in the<head> tag:
This ensures that your account ID is available in the Data Layer, allowing GTM to access it across different tracking tags.
On all conversion pages (e.g., checkout success, registration complete), insert the following code above your GTM implementation in the<head> tag:
If your site includes multiple conversion events (e.g., add-to-cart β purchase), repeat the Data Layer push on each relevant page. For example:
- Cart Page (/cart) β Track when users add items to their cart:ο»Ώ
- Purchase Confirmation Page (/thank-you) β Track completed purchases:ο»Ώ
A live working example can be found here.
Step 1: accountId is configured as a Data Layer Variable.
Step 2: OmniSDK tag is firing on all pages.
Step 3: Click tracking tag is firing only on landing pages.
Step 4: Conversion tracking tag is firing only on conversion pages.
Step 5: Data Layer Variables are implemented correctly on your website.
By following these steps, you have successfully integrated MomentScience conversion tracking using Google Tag Manager. This setup ensures accurate tracking of user conversions while keeping your implementation scalable and flexible.
π’ If you're running into any issues while going through the integration process, feel free to contact us at help@momentscience.comο»Ώ