Shopify
What is the Shopify Custom Pixel
Shopify Custom Pixel is a feature that allows merchants to create and integrate custom tracking pixels on their Shopify store. These pixels help track specific events, user behavior, and conversions, providing valuable data for analytics and marketing purposes. Unlike standard pixels, custom pixels offer greater flexibility, enabling merchants to tailor their tracking to meet specific business needs or integrate with third-party services not natively supported by Shopify. This feature is particularly useful for advanced marketing strategies and detailed customer insights.
To get started swiftly, ensure you have the following prerequisites:
Shopify Site
JENTIS Account
At least one container within the JENTIS Account
Installation Steps
Shopify Store: Custom Pixel
Log into your Shopify account.
Navigate to Settings > Customer Events.
Press Add custom pixel and define a good name f.e. JENTIS.
Set the settings the following way:

Add in the Codeblock the following code:
In the previous code, make sure to replace the following values with the according values from your container settings:
You can find your container settings in your JENTIS platform under Containers > Setup. Select the container associated with your Shopify shop.
For the short value use the container ID as presented in the screenshot (ie. "jtm_demo_com"):

For the following values you'll find them within the Tracking Code snippet:

hashis the sub-domain section generated with your JENTIS Container (equivalent to the DNS A Record value), in example:kndmjhdomainis the full origin where the DNS A record is living, in example:mision.jtm-demo.comfilehashis the name of the.jsfile, ie.2d23agenvironmentcan be staticliveand used with all environments (optionally usestageandlivedynamically based on your own rules, so you can publish different testing versions with your site)
Save the custom pixel.
JENTIS Platform: Install the Shopify Plugin
Open your JENTIS platform and navigate to Server Tag Manager > Plugins.
Click on Add New Plugin.
Select the Shopify Datalayer-Bridge.
Define a good name and connect it to the right container.
JENTIS Platform: Create a Variable
In the JENTIS Platform, you might need to create an additional variable to retrieve the correct currency from the webpage.
By default, Tools in JENTIS use the Currency global variable. The value (e.g., EUR) set into this global variable is a constant available for all tools in the same Container.
However, based on the visitor's browser localization, your webpage could automatically change prices and currencies on product-related pages. For example, a user visiting www.example.de from the United Kingdom, but instead of redirecting to the UK domain, Shopify changes the currency from EUR to GBP and the prices accordingly. The global currency variable will still give EUR, leading to data discrepancies in your analytics tools.
To overcome this situation, you must use the following code to create a Client-side Javascript variable that will dynamically retrieve the most up-to-date currency value from the webpage.
In your JENTIS Platform, go to Server Tag Manager → Variables. Click on Add New Variable → Client-side → Client-side Javascript Code, and copy-paste the following code:
Make sure to click the ‘Add' button.
Use this variable to replace the default Currency global variable in all the necessary Tags. If you are satisfied with the outcome, publish your changes.
JENTIS Platform: Connect the CMP-Bridge
The JENTIS CMP-Bridge serves as a connector that transfers consent from the main website's consent banner via the Customer Privacy API to the Shopify Sandbox environment. This means you will still need to use your preferred CMP (e.g., Cookiebot) on the Shopify website and extend it with custom code to integrate the Customer Privacy API, as documented by your CMP vendor (e.g., Cookiebot Shopify Installation Guide).
In the JENTIS Shopify CMP-Bridge, you need to configure which vendors are linked to specific Customer Privacy API groups as passed by your original CMP vendor on the page. This ensures proper consent synchronization and adherence to your privacy configuration.
Open your JENTIS platform and navigate to Legal Hub → Consentbars.
Connect the Shopify CMP-Bridge with the container.
Afterward, open the corresponding vendors under Legal Hub → Vendors and edit the CMP-Settings.
Predefined Vendor Categories are analytics, marketing, and preferences.
Events tracked by the Shopify Plugin
The Shopify Plugin automatically tracks the following events:
pageviewsearchcartviewproductlistproductviewaddtocartremovefromcartcheckoutorder
This comprehensive tracking allows you to gain valuable insights into your Shopify store's performance.
Q&A
Why is JENTIS Preview Mode not working?
To run the preview mode, copy and paste your debug link from the preview session into the browser and execute it. After the page has loaded, remove all preview link URL parameters and reload the page. The preview should now load correctly. If not, please reload the page again.
How to access the custom_event information?
We have added a property called 'shopify' to all JENTIS DataLayer commands. This property contains the original event information passed from Shopify. If certain information is not provided in the default JENTIS DataLayer, you can access the 'shopify' property to retrieve the necessary details yourself.
Why is the tracked URL different from what I see in my browser?
As Shopify Custom Pixels are placed in separate sandbox environments, the URL provided for each event will be different to the one you see in your browser's address bar. E.g.,
document.location.href = "https://yourshop.myshopify.com/web-pixels@0e8c7c7aw41bd75a1p837d7fd4m8b145375/custom/web-pixel-129040453@22/sandbox/modern/collections/all"
However an easy solution is to create a Get JTM data layer value variable to return the correct URL: shopify.context.document.location.href

We recommend enabling the Full JENTIS Data Layer Lookback feature for this variable. This will ensure that the URL continues to appear in events occurring after the page view, even if Shopify does not provide the URL parameter in the event data.
How to access the JENTIS dataLayer (_jts) in the developer console?
As mentioned before, Shopify Custom Pixels are placed in separate sandbox environments. This means that executing any command in the developer console won't directly interact with the custom pixel.
First we need to know in which sandbox our pixel resides. To do that, it's best to add some sort of a console.log() inside our Shopify Custom Pixel (e.g., at the end of the pixel code). E.g.,
console.log('%c[JENTIS pixel]', 'color:#e91e8c;font-weight:bold', 'sandbox loaded');

Then, click on the link on the right side which should lead you to the Sources tab in your dev tools. Once you do that, you should see the sandbox name starting with web-pixel-sandbox(...).

All you need to do now is go back to the Console tab and select the correct context by clicking on the drop-down menu at the top. It should say top by default.

Verify whether you have selected the correct one by typing in _jts .

Can I access the payment method during checkout?
No, the payment method can only be accessed during the checkout_completed event.
If you have any questions or suggestions, contact us through our Helpdesk.
Last updated
Was this helpful?