Developer Guide
API GuideDeveloper Guide
  • Overview
    • Getting Started
    • Customers and Visitors
    • Events and Business Objects (BOs)
      • Sample Event Templates
  • Website
    • Getting Started
      • Direct JS Implementation
      • JS Integration via GTM
      • Tracking Haravan website events
    • Tracking Users
    • Tracking Events
      • [Direct] Sample E-Commerce Events
        • View Product
        • Add a Product to the Shopping Cart
        • View the Shopping Cart
        • Remove a Product from the Shopping Cart
        • Search for Product(s)
        • Checkout Shopping Cart
        • Apply Promotion Code
        • Purchase Product(s)
      • [GTM] Sample E-Commerce Events
        • View Product
        • Add a Product to the Shopping Cart
        • View the Shopping Cart
        • Remove a Product from the Shopping Cart
        • Search for Product(s)
        • Checkout Shopping Cart
        • Apply Promotion Code
        • Purchase Product(s)
    • Web Push
  • Android
    • Getting Started
    • Tracking Users
    • Tracking Events
    • Push Messaging
    • App Inbox Messaging
  • iOS
    • Getting Started
      • Integration of Antsomi iOS SDK
    • Tracking Users
    • Tracking Events
    • Push Messaging
  • Hybrid Apps
    • React Native
      • Tracking Users
      • Tracking Events
        • Sample E-Commerce Events
          • View Product
          • Add a Product to the Shopping Cart
          • View the Shopping Cart
          • Remove a Product from the Shopping Cart
          • Search for Product(s)
          • Checkout Shopping Cart
          • Apply Promotion Code
          • Purchase Product(s)
      • Push Messaging
      • App Inbox Messaging
    • Flutter
      • Tracking Users
      • Tracking Events
        • Sample E-Commerce Events
          • View Product
          • Add a Product to the Shopping Cart
          • View the Shopping Cart
          • Remove a Product from the Shopping Cart
          • Search for Product(s)
          • Checkout Shopping Cart
          • Purchase Product(s)
      • Push Messaging
      • App Inbox Messaging
      • App In-line Content
  • Antsomi Service Integrations
    • Media Template
    • Media JSON
      • Sample E-Commerce Events
        • Search for Product(s)
        • View Product
        • Add a Product to the Shopping Cart
        • Checkout Shopping Cart
        • Purchase Product(s)
      • Sample User Events
        • Sign-in
        • Sign-up
      • Sample Opt-in Events
        • Subscribe to Email marketing
        • Subscribe to OneSignal channel
  • 3rd Party Integrations
    • Shopify
      • Tracking Shopify website events
    • LINE
      • Integrating LINE Login with your web app
    • Google Ad Manager
      • Targeting CDP365 segment via PPID(s)
Powered by GitBook
On this page
  • Tracking Event Page View
  • Tracking Other Events
  1. Website

Tracking Events

PreviousTracking UsersNext[Direct] Sample E-Commerce Events

Last updated 1 year ago

Must Read

We recommend that you get yourself acquainted with the concept of , , and their attributes before proceeding. Doing so will help you understand the workings of this section, better.

Antsomi offers a comprehensive solution for tracking various events within your website using the web_event.track() method. This method encompasses both System Events and Custom Events, providing you with a unified approach to monitor user interactions and behaviors effectively.

Tracking Event Page View

After a successful integration of the AntsomiSDK into your website, page view tracking will be performed automatically by the SDK. To enhance your tracking capabilities, you can include additional attributes, such as page_type and page_category by assigning them to the object _cdp365Analytics before the SDK is loaded. These attributes will be associated with the page view event.

Here's an example of how you can set these attributes:

var _cdp365Analytics = {
    page: {
        page_type: "{{page_type}}",
        page_category: "{{page_category}}"
    }
};

Tracking Other Events

Other events beyond page views can be effortlessly tracked using the Antsomi SDK's web_event.track() method within your website. This method allows you to monitor user interactions and events, providing you with comprehensive insights into user behavior. Additionally, you have the flexibility to include associated data as Event Attributes with each event, enriching your Antsomi dashboard with valuable contextual information.

For example, the add-to-cart event can be tracked as follows:

web_event.track("product", "add_to_cart", {
    items: [
        {
            type: "product",
            id: "{{product_sku}}",
            name: "{{product_name}}",
            sku: "{{product_sku}}",
            page_url: "{{product_page_url}}",
            image_url: "{{product_featured_image}}",
            price: "{{product_sale_price}}",
            original_price: "{{product_original_price}}",
            main_category: "{{product_main_category}}",
            variant: "{{product_variant_name}}",
            color: "{{product_color}}",
            size: "{{product_size}}",               
            parent_item_id: "{{product_parent_id}}",
            variant: "{{product_variant_name}}",
            status: "active",            
            is_parent: "false",
            quantity: "{{product_quantity}}",
            cdp_source: "Staging" // Staging/Production
        }
    ],
    dims: {
        customers: {
            customer_id: "{{customer_id}}",
            name: "{{customer_name}}",
            email: "{{customer_email}}",
            phone: "{{customer_phone}}",
            cdp_source: "Staging" // Staging/Production
        }
    },
    extra: {
        cart_subtotal: "{{cart_subtotal}}",
        cart_item_count: "{{cart_item_count}}",
        identify_id: "{{customer_id}}",
        identify_type: "exact",
        identify_event: "add_to_cart",
        identify_time: "{{identify_time}}",
        event_source: "add_to_cart"
    }
});

Keep in mind that only the attributes registered in the system can be received in CDP.

For a sample event tracking template, you can refer to one of the links below:

E-Commerce Events
System Events
Custom Events