---
title: How to enable Headless Mode in Shopify
description: Follow the steps below to enable headless mode for Shopify
---

[Skip to content](https://knowledge.profitmetrics.io/how-to-enable-headless-mode-in-shopify#main-content)

[![ProfitMetrics logo black version](https://knowledge.profitmetrics.io/hs-fs/hubfs/pm_logotype_blue.png?width=193&height=28&name=pm_logotype_blue.png)](https://knowledge.profitmetrics.io/?hsLang=en)

Open main navigation

Close main navigation

- [Contact Support](https://knowledge.profitmetrics.io/kb-ticket/new)

[Contact Support](https://knowledge.profitmetrics.io/kb-ticket/new?hsLang=en)

 How can we help you?

- There are no suggestions because the search field is empty.

1. [Knowledge base](https://knowledge.profitmetrics.io/?hsLang=en)
2. [E-commerce Platforms](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en)
3. [Shopify](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#shopify)

# How to enable Headless Mode in Shopify

## Follow the steps below to enable headless mode for Shopify

The headless implementation for Shopify is very easy and consists of 3 parts. Please follow them carefully.

---

[Part 1: Contact support@profitmetrics.io to enable headless mode](https://knowledge.profitmetrics.io/how-to-enable-headless-mode-in-shopify#part1)

[Part 2: Install the Server-side Hybrid Universal Integration Custom Pixel in Shopify](https://knowledge.profitmetrics.io/how-to-enable-headless-mode-in-shopify#part2)

[Part 3: Install the Server-side Hybrid Universal Integration tracking script on your website](https://knowledge.profitmetrics.io/how-to-install-the-server-side-hybrid-universal-integration-script?hsLang=en)

---

### Part 1: Contact support@profitmetrics.io to enable headless mode

Please contact [support@profitmetrics.io](mailto:support@profitmetrics.io) and send the following email:

```
Hi ProfitMetrics,Please enable headless mode for our Shopify store [URL].
```

We will send you a confirmation as soon as it is enabled.

Part 2: Install the Server-side Hybrid Universal Integration Custom Pixel in Shopify

IMPORTANT: You will need to add a script to your website as well as inside Shopify. If you are using Google Tag Manager, please ensure Google Tag Manager is loading correctly on the order confirmation page.

1. Click Settings  
   ![Set Up Custom Pixel for ProfitMetrics in Shopify - Step 2](https://knowledge.profitmetrics.io/hs-fs/hubfs/Set%20Up%20Custom%20Pixel%20for%20ProfitMetrics%20in%20Shopify%20-%20Step%202.png?width=670&height=375&name=Set%20Up%20Custom%20Pixel%20for%20ProfitMetrics%20in%20Shopify%20-%20Step%202.png)
2. Click "Custom event"  
   ![Set Up Custom Pixel for ProfitMetrics in Shopify - Step 3](https://knowledge.profitmetrics.io/hs-fs/hubfs/Set%20Up%20Custom%20Pixel%20for%20ProfitMetrics%20in%20Shopify%20-%20Step%203.png?width=670&height=375&name=Set%20Up%20Custom%20Pixel%20for%20ProfitMetrics%20in%20Shopify%20-%20Step%203.png)
3. Click "Add custom pixel"  
   ![Set Up Custom Pixel for ProfitMetrics in Shopify - Step 4](https://knowledge.profitmetrics.io/hs-fs/hubfs/Set%20Up%20Custom%20Pixel%20for%20ProfitMetrics%20in%20Shopify%20-%20Step%204.png?width=670&height=375&name=Set%20Up%20Custom%20Pixel%20for%20ProfitMetrics%20in%20Shopify%20-%20Step%204.png)
4. Set consent to now required and data not qualify as data sale
5. Type "**PM - Headless mode**" in Pixel name and click **Add pixel**  
   ![Set Up Custom Pixel for ProfitMetrics in Shopify - Step 7](https://knowledge.profitmetrics.io/hs-fs/hubfs/Set%20Up%20Custom%20Pixel%20for%20ProfitMetrics%20in%20Shopify%20-%20Step%207.png?width=670&height=375&name=Set%20Up%20Custom%20Pixel%20for%20ProfitMetrics%20in%20Shopify%20-%20Step%207.png)
6. Copy and paste the following script. Remember to replace PUBLIC\_ID with your actual Public ID found in [ProfitMetrics \> Website](https://my.profitmetrics.io/customer/websites.php)
   
   ```
   // Start - ProfitMetrics Serverside Hybrid Universal Integration - (v3)// Configurationconst pmPublicID = 'YOUR_PUBLIC_ID'; // Your Public IDconst pmEmailInputSelector = '#email'; // Comma-separated CSS Selectorconst pmCookieDomain = ''; // Your top-level domainconst pmRememberConsent = false; // Remember consent from previous pagelet pmEmail;// Default consentlet customerPrivacyStatus = init.customerPrivacy;let cc_statistics = false;let cc_marketing = false;// Update consentfunction updateConsent() {    if (!pmRememberConsent) {        cc_statistics = customerPrivacyStatus.analyticsProcessingAllowed;        cc_marketing = customerPrivacyStatus.marketingAllowed;    } else {        try {            const pmStorageCookie = document.cookie                .split('; ')                .find(row => row.startsWith('pmStorage='))?.split('=')[1];            if (pmStorageCookie) {                const pmStorage = JSON.parse(decodeURIComponent(pmStorageCookie));                cc_statistics = pmStorage?.cc_statistics ?? cc_statistics;                cc_marketing = pmStorage?.cc_marketing ?? cc_marketing;                if (!cc_statistics && !cc_marketing) return false;            }        } catch {            // Handle errors silently        }    }}// Load bundle.jsfunction pmLoadScript() {   window.profitMetrics = {      pid: pmPublicID,      cookieStatisticsConsent: cc_statistics,      cookieMarketingConsent: cc_marketing,      emailInputSelector: pmEmailInputSelector,      onLoad: () => {         if (pmEmail && pmEmail.includes('@') && pmEmail.includes('.') && !/\s/.test(pmEmail)) {            profitMetrics.setEmail(pmEmail);         }      }   };   if (pmCookieDomain) {      window.profitMetrics.cookieDomain = pmCookieDomain.startsWith('.') ? pmCookieDomain : '.' + pmCookieDomain;   }   const script = document.createElement('script');   script.src = `https://cdn1.profitMetrics.io/${pmPublicID}/bundle.js`;   script.defer = true;   script.onerror = () => console.error('Failed to load ProfitMetrics script.');   document.head.appendChild(script);}// Visitor Consent Collectedapi.customerPrivacy.subscribe('visitorConsentCollected', (event) => {  customerPrivacyStatus = event.customerPrivacy;  updateConsent();  pmLoadScript();});//subscribe to eventsanalytics.subscribe("checkout_completed", (event) => {  pmEmail = event.data?.checkout?.email;  updateConsent();  pmLoadScript();});analytics.subscribe("payment_info_submitted", (event) => {  updateConsent();  pmLoadScript();});analytics.subscribe("checkout_shipping_info_submitted", (event) => {  pmEmail = event.data?.checkout?.email;  updateConsent();  pmLoadScript();});analytics.subscribe("checkout_address_info_submitted", (event) => {  pmEmail = event.data?.checkout?.email;  updateConsent();  pmLoadScript();});analytics.subscribe("checkout_contact_info_submitted", (event) => {  pmEmail = event.data?.checkout?.email;  pmLoadScript();});analytics.subscribe("checkout_started", (event) => {  updateConsent();  pmLoadScript();});analytics.subscribe("product_added_to_cart", (event) => {  updateConsent();  pmLoadScript();});analytics.subscribe("cart_viewed", (event) => {  updateConsent();  pmLoadScript();});analytics.subscribe("page_viewed", (event) => {  updateConsent();  pmLoadScript();});analytics.subscribe("product_viewed", (event) => {  updateConsent();  pmLoadScript();});analytics.subscribe("search_submitted", (event) => {  updateConsent();  pmLoadScript();});analytics.subscribe("collection_viewed", (event) => {  updateConsent();  pmLoadScript();});// End - ProfitMetrics Serverside Hybrid Universal Integration
   ```
   
   ![Shopify Workflow - Step 2](https://knowledge.profitmetrics.io/hs-fs/hubfs/Shopify%20Workflow%20-%20Step%202.png?width=589&height=329&name=Shopify%20Workflow%20-%20Step%202.png)
7. Click **Save**  
   ![Set Up Custom Pixel for ProfitMetrics in Shopify - Step 17](https://knowledge.profitmetrics.io/hs-fs/hubfs/Set%20Up%20Custom%20Pixel%20for%20ProfitMetrics%20in%20Shopify%20-%20Step%2017.png?width=670&height=375&name=Set%20Up%20Custom%20Pixel%20for%20ProfitMetrics%20in%20Shopify%20-%20Step%2017.png)
8. Click **connect**  
   ![Set Up Custom Pixel for ProfitMetrics in Shopify - Step 19](https://knowledge.profitmetrics.io/hs-fs/hubfs/Set%20Up%20Custom%20Pixel%20for%20ProfitMetrics%20in%20Shopify%20-%20Step%2019.png?width=670&height=375&name=Set%20Up%20Custom%20Pixel%20for%20ProfitMetrics%20in%20Shopify%20-%20Step%2019.png)

 

- [Getting Started](https://knowledge.profitmetrics.io/getting-started?hsLang=en#main-content)

    - [Learn the Basics](https://knowledge.profitmetrics.io/getting-started?hsLang=en#learn-the-basics)
    - [Prepare for Onboarding](https://knowledge.profitmetrics.io/getting-started?hsLang=en#prepare-for-onboarding)
    - [Account Setup](https://knowledge.profitmetrics.io/getting-started?hsLang=en#account-setup)
- [E-commerce Platforms](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#main-content)

    - [Shopify](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#shopify)
    - [WooCommerce](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#woocommerce)
    - [Magento](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#magento)
    - [PrestaShop](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#prestashop)
    - [BigCommerce](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#bigcommerce)
    - [Shopware](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#shopware)
    - [DanDomain & Related](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#dandomain-related)
    - [Universal Integration (Clientside)](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#universal-integration-clientside)
    - [Universal Integration (Server-side Hybrid)](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#universal-integration-server-side-hybrid)
    - [Other Platforms](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#other-platforms)
    - [Developer Documentation](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#developer-documentation)
- [Ad Channels](https://knowledge.profitmetrics.io/ad-channels?hsLang=en#main-content)

    - [Google Ads](https://knowledge.profitmetrics.io/ad-channels?hsLang=en#google-ads)
    - [Meta (Facebook/Instagram)](https://knowledge.profitmetrics.io/ad-channels?hsLang=en#meta-facebook-instagram)
    - [Microsoft Bing Ads](https://knowledge.profitmetrics.io/ad-channels?hsLang=en#microsoft-bing-ads)
    - [Google Analytics 4](https://knowledge.profitmetrics.io/ad-channels?hsLang=en#google-analytics-4)
    - [Partner-ads](https://knowledge.profitmetrics.io/ad-channels?hsLang=en#partner-ads)
    - [Other Channel Configuration](https://knowledge.profitmetrics.io/ad-channels?hsLang=en#other-channel-configuration)
- [Tracking & Conversion Setup](https://knowledge.profitmetrics.io/tracking-conversion-setup?hsLang=en#main-content)

    - [Overview](https://knowledge.profitmetrics.io/tracking-conversion-setup?hsLang=en#overview)
    - [Conversion Booster for Google Ads](https://knowledge.profitmetrics.io/tracking-conversion-setup?hsLang=en#conversion-booster-for-google-ads)
    - [Conversion Booster for Meta](https://knowledge.profitmetrics.io/tracking-conversion-setup?hsLang=en#conversion-booster-for-meta)
    - [Conversion Booster Custom Pixels](https://knowledge.profitmetrics.io/tracking-conversion-setup?hsLang=en#conversion-booster-custom-pixels)
    - [Enhanced Conversions](https://knowledge.profitmetrics.io/tracking-conversion-setup?hsLang=en#enhanced-conversions)
- [Shopping Booster](https://knowledge.profitmetrics.io/shopping-booster?hsLang=en#main-content)

    - [Overview & Setup](https://knowledge.profitmetrics.io/shopping-booster?hsLang=en#overview-setup)
    - [Supplemental Feeds](https://knowledge.profitmetrics.io/shopping-booster?hsLang=en#supplemental-feeds)
    - [Campaigns & Labels](https://knowledge.profitmetrics.io/shopping-booster?hsLang=en#campaigns-labels)
    - [Troubleshooting](https://knowledge.profitmetrics.io/shopping-booster?hsLang=en#troubleshooting)
- [Product Feed & Costs](https://knowledge.profitmetrics.io/product-feed-costs?hsLang=en#main-content)

    - [Product Feed](https://knowledge.profitmetrics.io/product-feed-costs?hsLang=en#product-feed)
    - [Shipping & Payment Costs](https://knowledge.profitmetrics.io/product-feed-costs?hsLang=en#shipping-payment-costs)
    - [Expenses](https://knowledge.profitmetrics.io/product-feed-costs?hsLang=en#expenses)
- [Dashboard, Orders & Reporting](https://knowledge.profitmetrics.io/dashboard-orders-reporting?hsLang=en#main-content)

    - [Dashboard & Orders](https://knowledge.profitmetrics.io/dashboard-orders-reporting?hsLang=en#dashboard-orders)
    - [Looker Studio](https://knowledge.profitmetrics.io/dashboard-orders-reporting?hsLang=en#looker-studio)
    - [Google BigQuery](https://knowledge.profitmetrics.io/dashboard-orders-reporting?hsLang=en#google-bigquery)
- [Account & Billing](https://knowledge.profitmetrics.io/account-billing?hsLang=en#main-content)

    - [Users & Access](https://knowledge.profitmetrics.io/account-billing?hsLang=en#users-access)
    - [Billing & Invoices](https://knowledge.profitmetrics.io/account-billing?hsLang=en#billing-invoices)
- [Privacy & Consent](https://knowledge.profitmetrics.io/privacy-consent?hsLang=en#main-content)

    - [GDPR](https://knowledge.profitmetrics.io/privacy-consent?hsLang=en#gdpr)
    - [Consent Management Platforms](https://knowledge.profitmetrics.io/privacy-consent?hsLang=en#consent-management-platforms)
    - [Google Consent Mode](https://knowledge.profitmetrics.io/privacy-consent?hsLang=en#google-consent-mode)
- [For Agencies](https://knowledge.profitmetrics.io/for-agencies?hsLang=en#main-content)

    - [Getting Started as an Agency](https://knowledge.profitmetrics.io/for-agencies?hsLang=en#getting-started-as-an-agency)
    - [Agency Certification](https://knowledge.profitmetrics.io/for-agencies?hsLang=en#agency-certification)
- [Shopify](https://knowledge.profitmetrics.io/shopify?hsLang=en)
- [PrestaShop](https://knowledge.profitmetrics.io/prestashop?hsLang=en)
- [Google Ads](https://knowledge.profitmetrics.io/google-ads?hsLang=en#main-content)

    - [troubleshoot](https://knowledge.profitmetrics.io/google-ads?hsLang=en#troubleshoot)
- [Meta (Facebook / Instagram)](https://knowledge.profitmetrics.io/meta-facebook-instagram?hsLang=en)
- [Uncategorized](https://knowledge.profitmetrics.io/uncategorized?hsLang=en)
- [Billing](https://knowledge.profitmetrics.io/billing?hsLang=en)
- [Google Sheets](https://knowledge.profitmetrics.io/google-sheets?hsLang=en)
- [Account](https://knowledge.profitmetrics.io/account?hsLang=en)
- [Ideal Shop](https://knowledge.profitmetrics.io/ideal-shop?hsLang=en)

[![ProfitMetrics logo black version](https://knowledge.profitmetrics.io/hs-fs/hubfs/pm_logotype_blue.png?width=193&height=28&name=pm_logotype_blue.png "ProfitMetrics logo black version")](https://profitmetrics.io)

<https://www.facebook.com/ProfitMetrics/> <https://podcasts.apple.com/> [mailto:support@profitmetrics.io](mailto:support@profitmetrics.io)

Copyright © 2026, ProfitMetrics ApS