When to use this method:
Use this method if you are not utilizing Google Tag Manager (GTM) and want to integrate Mintegral Pixel directly into Shopify.
Steps:
-
Insert the following Shopify Code in the correct Shopify location (similar to Method 1).
Shopify Code
(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"); analytics.subscribe("all_events", async (e) => mintegralPixel("track", { type: e.name, data: e.data, meta: { thrid_party: 'shopify', init: init } }));
-
(Optional) Add manual event reporting by copying and pasting the following Event Reporting Code:
⚠️Tip: Skip this step if you do not need to manually report events.
Event Reporting Code
mintegralPixel("track", { "type": "", // Event name "data": "", // Event data (can be object or string) "meta": "" // Additional info (can be object or string) });