Search...
Menu

Mintegral Pixel: Direct Integration to Custom Online Store Guide

Label:mintegral pixel ,directions ,DTC ,user guide ,custom online store

Direct Code Integration to a Custom Online Store

Use case: Your custom online store does not use GTM or you prefer embedding the SDK directly.

Integration Steps

Step 1: Load the Pixel SDK

Copy and paste the following script into your website globally.

(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
});

Step 2: Reporting MTG Official Events

mintegralPixel("track", {
  "type": <event_name>, 
  "data": <event_data>
});

Parameters

Name

Type Description
type string
data object

Enhanced User Identification (Recommended) 

The Mintegral Pixel sets a first-party cookie _mtgtrk to identify users. This cookie is automatically sent in every request to your website. To enhance user identification, Mintegral strongly recommends that you perform the following on the back-end of your site:

Whenever you see the cookie _mtgtrk in an HTTP request, set the HTTP response so that it includes a header which sets a new first-party HTTP cookie mtgtrk (remove the underscore from the beginning) with a one-year expiration date.

  • The value of this new cookie should be exactly the same as the value of the corresponding _mtgtrk cookie in the incoming request
  • The domain for the cookie should be your site, prefixed with a period
    • Example: if your site is yoursite.com, the domain attribute should be .yoursite.com.
    • ⚠️ Note"www" should not be included here
  • The path for the cookie should be /
  • Do not set the cookie to be HttpOnly

Example:

If your site receives an HTTP request where the value of the _mtgtrk cookie is:

exxxxxxx-8xxx-4xxx-bxxx-1xxxxxxxxxxx

Then your HTTP response should include:

Set-Cookie: mtgtrk=exxxxxxx-8xxx-4xxx-bxxx-1xxxxxxxxxxx;
Expires=«One Year from Today»; Domain=«.yoursite.com»; Path=/; SameSite=Lax;
Previous
Mintegral Pixel: Custom Website Integration via Google Tag Manager Guide
Next
Mintegral Pixel: Standard Events and Objects Guide
Last modified: 2025-09-25