LogoLogo
Go to Console
  • Welcome to Ingest Labs Documentation
  • Navigation
    • Navigating Through UI
  • Tag Manager
    • Introduction
    • Add a New Project
    • Dashboard
      • Dashboard Screen
      • Create a New Dashboard
      • Add Widgets in the Dashboard
      • Configure Default Dashboard
      • Edit Dashboard
      • Delete Dashboard
      • Share Dashboard
      • Change Dashboard
    • Reports
      • Reports Screen
      • Adding a Filter to Reports
    • Tags
      • Tags Screen
      • Configuration of Tags
      • Add a New Tag (Browser)
      • Add a New Tag (Server)
      • Edit a Tag
      • Disable a Tag
      • Enable a Tag
      • Restore the Changes
      • Tag Version
    • Data Elements
      • Data Elements Screen
      • Add a New Data Element (Browser)
      • Add a New Data Element (Server)
      • Edit a Data Element
      • Delete a Data Element
      • Restore the Changes
      • Data Element Version
    • Providers
      • Providers Screen
      • Add a New Provider (Browser)
      • Add a New Provider (Server)
      • Edit a Provider
      • Delete a Provider
      • Provider Version
    • Triggers
      • Triggers Screen
      • Add a New Trigger (Browser)
      • Add a New Trigger (Server)
      • Edit a Trigger
      • Delete a Trigger
      • Restore the changes
      • Trigger Version
      • Record Trigger Feature
    • Qualification Criteria
      • Qualification Criteria Screen
      • Add a New Qualification Criteria (Browser)
      • Add a New Qualification Criteria (Server)
      • Edit a Qualification Criteria
      • Delete a Qualification Criteria
      • Restore the Changes
      • Qualification Criteria Version
    • Transformers
      • Transformers Screen
      • Add a New Transformer (Browser)
      • Add a New Transformer (Server)
      • Edit a Transformer
      • Delete a Transformer
      • Restore the Changes
      • Transformers Version
    • Publish
      • Publish Screen
      • Publish the Tag to Staging
      • Publish the Tag to Production
    • Live Debugging
      • Retrieve the Debug ID Using Console
      • Using Ingest Labs Debugging Session
      • Filter the Events During Live Debugging
    • Data Governance
      • Data Governance Screen
      • Edit Data Governance Status
      • View Data Governance Timeline
      • New Consent Classification
    • Environments
      • Environments Screen
      • View Production Environment
      • View Staging Environment
    • Settings
    • Alarms
      • Alarms Screen
      • Add a New Alarm (Tag Anomaly Detection Alarm)
        • Add Funnel Monitoring Alarm
      • Add a New Alarm (Tag Expiration Alarm)
      • Funnel Monitoring Alarm Feature
        • Delete an Alarm
      • Edit an Alarm
      • Delete an Alarm
  • Media Data Platform
    • About Media Data Platform
    • Dashboard
      • Dashboard Screen
      • Create a New Dashboard
      • Add Widgets in the Dashboard
      • Edit a Widget
      • Export a Widget
      • Refresh a Widget
      • Delete a Widget
      • Resize and Reorder Widgets
      • Edit Dashboard
      • Switch Dashboard
      • Add Widget to MDP Dashboard
      • Make Default Dashboard
      • Share Dashboard
      • Delete Dashboard
    • Connectors
      • Connectors Screen
      • Add a Connector
      • Edit a Connector
      • Delete a Connector
    • Segments
      • Segments Screen
      • Add a New Segment
      • Edit a Segment
      • Delete a Segment
      • Restore to a Segment Version
    • Audiences
      • Audiences Screen
      • Download Audience Report
    • Data Sources
      • Data Sources Screen
      • Add a Data Source
      • Edit Data Source
      • Delete Data Source
    • Destinations
      • Destination Screen
      • Add a New Destination
      • Edit Destination
      • Delete Destination
    • Pipelines
      • Pipelines Screen
      • Add a New Pipeline
      • Edit Pipeline Data Source Schema
      • Activate Pipeline
      • Delete a Pipeline
      • Edit Pipeline Destinations
      • Edit Pipeline Triggers
      • CDP Pipeline: Overview of Pre-Defined Filters in Destinations
      • Ensuring Reliable Data Transfers: Retry Configuration
  • Site Performance
    • About Site Performance
    • Site Performance Screen
    • Configure Test Suites
      • Add a New Test Suite
      • Edit a Test Suite
      • Delete a Test Suite
    • Configure Variants
      • Initiate a Test
      • Check Test History
      • Add a New Variant
      • Edit Variant
      • Disable Variant
      • Delete Variant
    • Site Performance
  • Implementation
    • Web SDK
      • Installation
        • Ingest Labs Script
        • GTM Events Import
      • Tracking Events
        • Page Load
        • Calendly booked
        • Search
        • Login
        • View Item
        • View Item List
        • Add To WishList
        • View Wishlist
        • Add To Cart
        • Remove From Cart
        • View Cart
        • Begin Checkout
        • Add Shipping Info
        • Add Payment Info
        • Purchase
        • Quick Buy
        • View Similar Items
        • Pin Code Check
        • Store Client Session
        • Form Submit Errors
        • Form Submit Warning
        • Custom event
        • Products Array
  • S2S
    • Setup
    • Tracking Events
      • Begin Checkout
      • Add Shipping Info
      • Add Payment Info
      • Purchase
      • Products Array
  • DNS Configuration
    • GoDaddy
Powered by GitBook
LogoLogo

© 2025, Ingest Labs. All rights reserved.

On this page
Export as PDF
  1. Implementation
  2. Web SDK
  3. Tracking Events

Purchase

When the purchase success page is loaded (thankyou.html), fire the following scriptlet to capture the purchase information

window._mp.safeExecute('evPurchase', function() {

   /**
    * if user does not have first name and last name, split the name using space
    * and assign first half to fName and second to lName
    *
    *
    * Example:
    * var userName = 'full name';
    * var fName = '';
    * var lName = '';
    * 
    * if (userName.indexOf(' ') > -1) {
    *   fName = userName.split(' ')[0];
    *   lName = userName.split(' ')[1]; 
    * } else {
    *   fName = userName;
    *   lName = undefined;
    * }
   */

   eedl('user_info', {
      pid: '<unique identifier representing user>',
      email: '<email address of user>',
      phone: '<phone number of user - no country code>',
      country: '<country code only>',
      city: '<city - madurai>',
      state: '<state - Tamil Nadu>',
      fName: '<first name of user>',
      lName: '<last name of user>',
      zip: '<zip code>',
   });

   eedl('mp_purchase', {
      currency: 'INR', /* Currency of website */
      transaction_id: '<order id - KETCH00xxxx>', /* Order Id of transaction */
      cart_id: '<unique cart id>', // mandatory
      value: 123.33, // float value of order
      coupon: '<optional coupon>', // Leave this undefined if there is no coupon
      shipping: 123.33, // total shipping value in float
      tax: 123.33, // total tax value in float
      items: [ // array of items
         {
            item_id: '<mandatory - item_id>',
            item_name: '<mandatory - name of item>',
            item_sku: '<mandatory - style id of item>',
            index: 0, // order of item in array 0,1,2,3...
            price: 123.33, // mandatory - float price - DO NOT MULTIPLY with quantity.
            quantity: 2, // quantity of item
            item_brand: '<optional - brand>', // if not available leave undefined
            item_category: '<optional - category>', // if not available leave undefined
         }
      ],
      ev_source: 'gtm'
    });
  })();
PreviousAdd Payment InfoNextQuick Buy

Last updated 1 month ago

Products Array