Direct Offer Conversion Tracking (OmniSDK)
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.
- Open the HTML <head> section of your website.
- Insert the following script:
// ๐ 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.
- Open your landing pageโs HTML <body> section.
- Insert the following script:
//๐ 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.
- Open your conversion pageโs HTML <body> section.
- Insert the following script:
<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๏ปฟ