---
title: Direct Offer Conversion Tracking (OmniSDK)
slug: direct-offer-conversion-tracking-omnisdk
icon: 🛰️
docTags: 
createdAt: 2025-02-25T15:02:50.771Z
---

:::hint{type="info"}
**Who is this for:** Advertiser developers or web implementers who prefer direct JavaScript-based conversion tracking on landing and conversion pages.

**Outcome:** Embed OmniSDK on all relevant pages to capture click IDs and fire conversion events, enabling accurate tracking of user interactions and completed conversions.
:::

# Overview

This guide walks you through setting up conversion tracking using MomentScience OmniSDK. By following these steps, you will be able to track user interactions and conversions effectively.

## Prerequisites

Before you begin, ensure you have:

- Your **MomentScience Partner ID** (obtain from your account manager)
- Your **Landing page URLs**
- Your **Conversion page URLs**

# Integration Steps

## Step 1: Add the MomentScience OmniSDK Script

The OmniSDK script must be included on **all landing pages and conversion pages**.

1. Open the **HTML&#x20;**`<head>`**&#x20;section** of your website.
2. Insert the following script:

:::CodeblockTabs{indent="2"}
```javascript
// 📌 Replace YOUR_PARTNER_ID with your actual Partner ID.
<script src="https://plugins.pubtailer.com/omnisdk.js?accountId=YOUR_PARTNER_ID"></script>
```
:::

✅ **This ensures that the SDK is available for tracking user events.**

## Step 2: Capture Click IDs on Landing Pages

This step ensures that any **click identifier** (adpx\_click\_id) from the **URL query string** is captured and stored in a **cookie** for later use.

1. Open your **landing page’s HTML \<body> section**.
2. Insert the following script:

:::CodeblockTabs{indent="2"}
```javascript
//📌 What this does:
// Extracts adpx_click_id from the URL query parameters.
// Stores the value in a cookie for later retrieval on the conversion page.
<script>
    handleAdpxClickId();
</script>
```
:::

✅ **This ensures proper tracking of user interactions from the initial click.**

## Step 3: Implement Conversion Tracking on Key Event Pages

On **conversion pages** (e.g., checkout confirmation, signup success), insert the following script to track successful events.

1. Open your **conversion page’s HTML \<body> section**.
2. Insert the following script:

:::CodeblockTabs{indent="2"}
```javascript
<script>
(async () => {
    const eventName = 'purchase';  // Replace with actual event name
    const sale_amount = 0;  // Replace with actual sale amount if applicable, otherwise leave as is
    // Retrieve stored click IDs  
    const mosciClickId = getCookie('mosci_click_id');
    // Send conversion data to MomentScience  
    await trackMoSciEvent(mosciClickId, eventName, sale_amount)
        .then(() => console.log('MomentScience tracking successful'))
        .catch(error => console.error('MomentScience tracking failed:', error));        
})();
</script>
```
:::

**Customization Options:**

- **Event Name:** Change` 'purchase'` to reflect the event (e.g.,`'signup'`,`'lead'`).
- **Sale Amount:** Set the value of the conversion (e.g., 5.00 for a $5.00 transaction).

📌 **How this works:**

- **Retrieves stored click IDs** from the cookie.
- **Sends the event details** to MomentScience and Adpx for tracking.

✅ **This ensures conversions are attributed correctly.**

# Final Checklist

- [ ] **Step 1:** The OmniSDK script is included on all pages.
- [ ] **Step 2:** Click tracking is implemented on landing pages.
- [ ] **Step 3:** Conversion tracking is firing correctly on event pages.
- [ ] **Step 4:** Event names and values are set correctly.

# Conclusion

By completing these steps, you have successfully integrated MomentScience conversion tracking into your website. This setup enables accurate conversion tracking while maintaining a lightweight and scalable implementation.

***

📢 If you're running into any issues while going through the integration process, feel free to contact us at [help@momentscience.com](mailto\:help@Momentscience.com)
