Skip to content

Shopify+CustomerLabs 1PD Ops Integration Guide

Shopify or Shopify Plus is an e-commerce platform that allows users to set up an online store. By connecting your Shopify store with CustomerLabs 1PD Ops, you can start tracking the events (user-behavioral activity) of your website visitors without writing any code.

  • Admin Access to Shopify Store backend
  • Active CustomerLabs Account

If you are using one-click checkout tools such as Fastrr (shiprocket), Gokwik, Shopflo, etc., please ensure to complete the integration steps mentioned in the respective tool’s documentation to push bottom-funnel events to the dataLayer or to the CustomerLabs webhook.

  1. Log in to the CustomerLabs account.
  2. If you do not have an account, Click “New to CustomerLabs? Sign up” below the login fields and Create a New Account
  1. Go to the Default Ecommerce Events section and click Shopify to open the integration setup.
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Add your domain name by clicking the “Add Domain” button.
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Open Shopify → Domain Settings, copy the domain name, and paste it into the setup.
  2. Click Next and close the modal.
Tracking Shopify Website with Customerlabs 1PD Ops
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Click “Open Shopify App Store” button and install the CustomerLabs App from Shopify App Store.
Tracking Shopify Website with Customerlabs 1PD Ops
Tracking Shopify Website with Customerlabs 1PD Ops
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Enter your CustomerLabs account email and API key.
Tracking Shopify Website with Customerlabs 1PD Ops
  1. To get the API key, go to CustomerLabs → Account Settings → API Key, and copy it.
Tracking Shopify Website with Customerlabs 1PD Ops
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Click Open the Theme Editor.
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Navigate to the App embeds and enable the toggle CL script.
  2. Click Save to apply the changes.
Tracking Shopify Website with Customerlabs 1PD Ops
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Navigate to the Default Product Page in your Shopify website.
Tracking Shopify Website with Customerlabs 1PD Ops
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Navigate to the Template section, click on Add Section.
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Go to the Apps tab, select CL Product block.
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Click Save to apply the changes.
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Go back to the instructions page → Click on the Open Checkout Settings.
Tracking Shopify Website with Customerlabs 1PD Ops
  1. In the Checkout Settings panel, click Customize.
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Go to App Embeds and on the left sidebar, Scroll to bottom → click on the + icon in Checkout Extension.
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Add the Checkout Extension to the Thank You page.
  2. Click Save.
  3. Go back to instructions page → click on Continue to Customer Events setup.
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Go to the instructions page
  2. Copy the code and click Open Customer Events Settings.
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Click on more views ** → click Custom Pixel → Click Add Custom Pixel.
Tracking Shopify Website with Customerlabs 1PD Ops
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Enter a name for your new pixel and name it “CustomerLabsPixel”.
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Paste the copied code snippet into the custom event script section.
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Scroll to lines 53 & 54 in the code and update them as true:
track_cart_token_on_addToCart: true,
use_variant_id_as_product_id: true,
Tracking Shopify Website with Customerlabs 1PD Ops
  1. If required, change the permissions to comply with privacy laws of your region. Click Save.
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Click Connect to connect the pixel.
Tracking Shopify Website with Customerlabs 1PD Ops
  1. Go back to instructions page → click on Continue to Webhook setup.

For the Purchase event data to be tracked correctly, we recommend bringing Purchase data from your Shopify store directly through Shopify Source (Webhook).

  1. Click the Connect button to start the webhook setup.
    Tracking Shopify Website with Customerlabs 1PD Ops
    Tracking Shopify Website with Customerlabs 1PD Ops
  2. Once the webhook is connected, Go to CustomerLabs and navigate to the Sources section to see if the source has been created successfully.
    Tracking Shopify Website with Customerlabs 1PD Ops

When we click Connect button in the Shopify, the system would have created a workflow automatically using a test trigger. We will have to verify the field mappings and re-name the workflow.

  1. Go to CustomerLabs → Sources. Find the shopify source.

    Tracking Shopify Website with Customerlabs 1PD Ops
  2. Click on the source name. Click on “Edit” in purchase_order workflow.

    Tracking Shopify Website with Customerlabs 1PD Ops
  3. In the Workflow setup, it is mandatory to update the delay. Click Choose Sample Data.

    Tracking Shopify Website with Customerlabs 1PD Ops
  4. Go to Event Configuration, change the event name to cl_purchase to differentiate with the purchase event received from browser side.

    Tracking Shopify Website with Customerlabs 1PD Ops
  1. Selecting the Sample: Select the sample with the cart token. Ensure data contains no parameters with null values.

    Tracking Shopify Website with Customerlabs 1PD Ops
  2. Filtering the Data (Optional): Here we can set filters for the data that comes from the source. Here, we set the filter to only when topic is order/create. Other filters can be Examples:

    • Filter out the order where email is null.
    • Filter out orders coming from a test store.
    • To capture only first time buyers, the filter can be set as customer__user_type as new.
    • To filter subscription purchase, the filter can be set by checking the source_name. It will contain subscription in the name or Shopify Sales Channel ID. Filter can be set accordingly.
  3. Event Configuration: Give the event name as cl_purchase by selecting a custom event. If filters are set up to capture specific data, then modify the event name accordingly. Example:

    • Subscription Purchases can be named as cl_subscription_purchase.
    • First time purchase can be named as cl_new_customer_purchase
  4. Identity Mapping:

    • Ensure to keep identify_by_email or identify_by_phone or shopify_cart_token.
    • Search for shopify cart token that starts with hWN in the payload. It is usually under cart_token or inside the note_attributes.
    Tracking Shopify Website with Customerlabs 1PD Ops
  5. Map Attributes: Map incoming attributes under User traits (first name, city, etc.).

  6. Product Details: Map product attributes (sku, ID, variant, line_items) under product details.

  7. Event Properties: Map value, currency, transaction_id, order_id.

  8. Click Save Workflow.

  1. Connecting Meta Destination
  2. Connecting Google Ads Destination