Search...
Menu

Mintegral Pixel: Custom Website Integration via Google Tag Manager Guide

Label:GTM ,google tag manager ,mintegral pixel ,user guide ,custom website

Integration Guide

This guide explains how to integrate the Mintegral Pixel on custom websites, including fully self-built websites, Shopify stores running in Headless Mode, or sites built with other CMS platforms.

There are two integration methods:

  1. Using Google Tag Manager (GTM) to manage scripts and tracking codes
  2. Directly embedding the Mintegral Pixel into your custom online store 

Both methods allow tracking of page views, user interactions, and conversion events.

In this guide, we will go over Method #1 and integrate through GTM.


Integration via Google Tag Manager (GTM)

Use case: Your website uses GTM to manage scripts and tracking codes.

Integration Steps

Step 1: Loading the Mintegral Pixel SDK

  • In GTM, navigate to Tags → New → Custom HTML Tag.
  • Paste the following code:
<script>
(function (w, d) {
  var u = "https://cdn-static.mintegral.com/sdk/pixel.js";
  if (w.mintegralPixel) return;
  var s = (w.mintegralPixel = function () {
    s.performOperation
      ? s.performOperation.apply(s, arguments)
      : s.operationQueue.push(arguments);
  });
  s.operationQueue = [];
  var f = d.getElementsByTagName("script")[0],
    e = d.createElement("script");
  e.async = !0;
  e.src = u;
  f.parentNode.insertBefore(e, f);
})(window, document);

mintegralPixel("init", {
  setupType: 1 // 1 - self-built website
});
</script>
  • Set the trigger to All Pages and save the tag.

⚠️ Note: Load the SDK only once per page to avoid duplicate events.

Step 2: Reporting Mintegral Official Events

Mintegral Event Data Structure

All events reported to Mintegral must follow this standard data structure:

Name Type Description
type string
data object

Copy and paste the following code and prepare the Data Layer on the Website.

dataLayer.push({
  "event": "purchaseEvent",
  "mtg_type": "purchase",
  "mtg_data": {
    "currency": "USD",
    "value": 179.98,
    "items": [
      {
        "item_variant_id": "sku123-blue-42",
        "item_id": "sku123",
        "item_name": "Air Sneakers",
        "price": 89.99,
        "quantity": 2,
        "image_url": "https://cdn.example.com/images/sku123.jpg"
      }
    ]
  }
});

⚠️ Note:

mtg_type and mtg_data must comply with Mintegral specifications.

eventis only used for GTM triggers and does not affect SDK reporting.

GTM Configuration

  • Create Data Layer Variables:

DLV - MTG Typemtg_type

DLV - MTG Datamtg_data

  • Create a Custom Event Trigger:

Event name: e.g., purchaseEvent

  • Create a Custom HTML Tag:

Copy and paste the following code, assign the trigger and publish the configuration.

<script>
mintegralPixel("track", {
  "type": "{{DLV - MTG Type}}",
  "data": {{DLV - MTG Data}}
});
</script>

 

Previous
Mintegral Pixel: Shopify Store Integration Guide
Next
Mintegral Pixel: Direct Integration to Custom Online Store Guide
Last modified: 2025-09-25