Shopify Custom Pixel

The TrueMetriks Shopify Custom Pixel tracks your pageviews, checkouts, and orders automatically. Here is how to set it up.

Set this up with AI

Copy this prompt into ChatGPT, Claude or whichever AI you use. It carries this whole guide, the pages it depends on, and a link to every video, so it can walk you through it one step at a time.

Open as text

Video guide

How to install the TrueMetriks Custom Pixel on Shopify

Copy the pixel code from your dashboard

In your TrueMetriks dashboard, go to Settings > Tracking, pick the Shopify tab, and click Copy on the code block.

Showing setup for Shopify

Install on Shopify

Add a Custom Pixel in Shopify to start sending events from your store to TrueMetriks and every ad platform you have connected.

CUSTOM PIXEL CODE

HTML
// ===== Shopify Custom Pixel - TrueMetriks Analytics =====
// Auto-generated for yourstore.com
// Paste into: Shopify Admin > Settings > Customer events > Add custom pixel
// Customer Privacy: set to "Not required", then Save -> Connect

Shopify admin → Settings → Customer events → Add custom pixel. Paste the code above, then Save → Connect.

Settings → Tracking → Shopify - copy the code, paste it into Shopify

Open Settings in Shopify Admin

Log in to your Shopify Admin. At the bottom of the main left sidebar, click Settings.

shopify
  • Home
  • Orders 5
  • Products
  • Customers
  • Marketing
  • Discounts
  • Content
  • Markets
  • Finance
  • Analytics
Sales channels
  • Online Store
Apps
Settings
Shopify admin sidebar - click Settings at the bottom

Open Customer events

The Settings panel slides in from the left. Scroll down and click Customer events.

Your Organization

Organization

  • Organization
  • Users
YS

Your Store

yourstore.myshopify.com

  • General
  • Plan
  • Billing
  • Payments
  • Checkout
  • Customer accounts
  • Shipping and delivery
  • Taxes and duties
  • Apps
  • Domains
  • Customer events
  • Notifications
  • Languages
  • Customer privacy
Settings panel - click Customer events

Click Add custom pixel

At the top right of the Customer events page, click the dark Add custom pixel button.

Customer events

Pixels

App pixels Custom pixels
Pixels Status
TrueMetriks
Connected
Customer events - click Add custom pixel

Name it TrueMetriks

In the Add custom pixel dialog, type TrueMetriks in the Pixel name field, then click Add pixel.

Add custom pixel

Did you check available apps first? Apps are the most secure option, with automatic updates, for integrating with third-party services.
TrueMetriks 11/30

This is an advanced feature that requires JavaScript knowledge. Shopify is not responsible for your use of pixels.

Add custom pixel - name it TrueMetriks, then click Add pixel

Paste the code and Connect

You land on the pixel editor. Find the Code section near the bottom of the page and replace the default content with the code you copied from your TrueMetriks dashboard. Then click Connect in the top right.

› TrueMetriks

Customer privacy

Permission ∨
Data sale ∨

Code

1// ===== Shopify Custom Pixel - TrueMetriks Analytics =====
2// Auto-generated for yourstore.com
3// Paste this entire block as-is
4(function () {
5  // ...
6})();
Pixel editor - paste the code, then click Connect

Leave the pixel's Customer privacy permission on Not required. That lets the pixel count visits cookieless before a visitor answers, and the pixel itself decides what more it may do.

If your TrueMetriks privacy mode is Consent banner (GDPR), turn on Shopify's own cookie banner in Shopify Admin under Settings, Customer privacy, Cookie banner. TrueMetriks' banner does not appear on Shopify; the pixel follows Shopify's. A visitor who allows both analytics and marketing gets full tracking, anyone else stays cookieless. Wherever Shopify's cookie banner is not turned on for a visitor's region, Shopify reports that visitor as allowing analytics and marketing and the pixel tracks them fully, so turning on Shopify's banner is what makes this mode ask your visitors.

In HIPAA (cookieless) mode the pixel sends nothing to Meta, Google or TikTok, so your ads will not optimize on Shopify orders.

The pixel code is generated for your privacy mode. Every time you change the mode, copy the code again from the dashboard and replace it here. See GDPR and HIPAA compliance for what each mode does.

Custom events

You can also send your own events from your Shopify theme, such as button clicks or scroll depth. The Events guide has the code and says where to paste it in theme.liquid.

If the TrueMetriks pixel code in Customer events does not contain tm_custom_event, copy it again from the dashboard and replace the old one, so it can receive custom events.

How to test

After connecting the pixel, the next step is verifying everything is firing correctly. See Test your integration for the full walkthrough.

Something not firing? See Troubleshooting.

Frequently asked questions

Where do I find the Custom Pixel code?

In your TrueMetriks dashboard at Settings > Tracking > Shopify. The code block has a Copy button and is generated for your specific store.

Do I need to install a Shopify app?

No. The Custom Pixel route does not require any Shopify App Store install. You paste the code directly into Shopify Admin under Settings > Customer events.

What should I set Customer Privacy to?

Set Permission to "Not required". In Consent banner (GDPR) mode the pixel then follows Shopify's cookie banner. The pixel code is generated for your privacy mode, so after any privacy-mode change, copy the pixel code again from the dashboard. See Privacy and consent below.

Does this work with all Shopify checkout flows?

Yes. The Custom Pixel runs across product pages, cart, checkout, and the post-purchase thank-you page.

How do I update the pixel later?

If we ship a code update, your dashboard will flag it on the Shopify tab. Copy the new code, open the existing pixel in Shopify Admin, replace the content of the Code section, then click Connect again.

Need help with this?

Reach us instantly on WhatsApp, or send us a message and we will get back to you. On workdays we usually respond in less than 24 hours.

or send us a message