Method 1: Import Prebuilt Container
When to use this method:
One-click upload of a pre-configured GTM container template.
Steps:
-
Log in to your GTM account.
-
Go to Admin > Import Container, and choose appropriate import options. (Contact your Mintegral account manager for the container file.)
-
(Optional) Add manual event reporting:
⚠️Tip: Please skip this step if you do not need to manually report events.
In the container template, we have by default referenced two variables. When integrating the Google Tag Manager JS using other platforms, please place the event value into either the
shopify
ordata
variable. Here is an example:// Shopify example dataLayer.push({ event: "page_loaded", shopify: { test: "test" }, }); // Custom platform example dataLayer.push({ event: "page_loaded", data: { test: "test" }, });
Method 2: Manual GTM Configuration
When to use this method:
Use GTM to load pixel.js
and configure events manually.
Steps:
-
Embed the script that loads
pixel.js
; On the Google Tag Manager configuration backend, go to Tags > New, and set up a Custom HTML tag (see Custom HTML Code snippet below).
Custom HTML 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"); </script>
For the trigger, select All Pages, then Save.
-
Manual Event Reporting:
2.1 Report All Events (Recommended)
-
In the Google Tag Manager configuration backend, go to Triggers – click New - click Custom Event, then use a regular expression to match all events by entering
^.+$
in the event name field, and check ✅ Use regex matching.
➢ In the Google Tag Manager configuration backend, go to Tags – click New, and set up a Custom HTML code snippet (see the Event Reporting Code HTML snippet below). Choose the previously defined trigger that matches all events, then click Save.
Event Reporting Code
<script> mintegralPixel("track", { "type": "", // Event name "data": "", // Event data(can be object or string) "meta": "" // Additional info(can be object or string) }); </script>
2.2 Report Selected Events
➢ In the GTM configuration backend, go to Triggers – click New, and create different types of triggers as needed.
➢ In the GTM configuration backend, go to Tags – click New, and set up a Custom HTML code snippet (refer to the Event Reporting Code HTML snippet below). Select the previously defined trigger as the firing condition, then click Save.
⚠️Note: Trigger examples in screenshots are for illustration. Create your own according to your needs.
Event Reporting Code
<script> mintegralPixel("track", { "type": "", // Event name "data": "", // Event data(can be object or string) "meta": "" // Additional info(can be object or string) }); </script>
-
Once completed, click Submit to publish and create a new version.