Articles on: CMS Overview

[Shopify] How to remove the old tagging pixel and Datalayer scripts

When integrating the AdPage app with your Shopify store, it's important to remove the old data layer (a system used to track customer behavior in your store) to ensure proper functionality. The old data layer, like the sld-datalayer, may have been used for previous tracking or analytics purposes, but it may no longer be compatible with the new setup. Keeping outdated data layers can lead to conflicts, inaccurate data tracking, or even prevent the new data layer from working as intended.

By removing the old data layer, you clear out unnecessary scripts and snippets, ensuring that your store works smoothly with our app. This process helps prevent any issues with data synchronization, tracking errors, or unexpected behavior in your store's analytics.

In this guide, we will walk you through the steps to remove the old data layer from your Shopify store.

Access the Online Store

Edit the Theme Files

Remove Snippets

Delete Data Layer Files from Assets

Remove Additional Data Layer Scripts

Let’s get started 🚀

Access the Online Store



Before you can start removing the old data layer, you'll first need to access the online store's theme code in Shopify. By logging into your Shopify admin panel, you can navigate to the necessary files where the old data layer code is stored. This is the first step to ensure that you're able to edit the theme files and remove the outdated code effectively.



Edit the Theme Files



Once you access the theme files, you’ll be able to find and edit the necessary sections of the theme code. In this step, you’ll remove the old data layer call code from the theme.liquid file. By doing so, you ensure that no outdated scripts or snippets interfere with the new data layer setup. Editing the theme files correctly is crucial for a smooth transition to the updated data layer configuration.



Remove Snippets



In Shopify, snippets are smaller pieces of code that are included in various theme files. These snippets may contain old data layer code, which could prevent your store from functioning properly with the new app integration. By removing these outdated snippets, you ensure that there are no leftover references to the old data layer in your store’s theme. This helps to clear out any remnants of the previous tracking setup, making space for the new configuration.

You have to delete the trytagging-body snippet if it's present, or if the code is directly placed in the body section without the snippet, remove the line that contains trytagging-body.



Delete Data Layer Files from Assets



After removing the snippets, the next step is to delete any files related to the old data layer from the Assets folder. These files may include JavaScript or other code that was used for tracking purposes in the old system. Deleting these files ensures that no outdated scripts are still being loaded by your store, which helps to maintain clean and efficient code.



Remove Additional Data Layer Scripts



Finally, it's essential to check the checkout settings in Shopify to ensure that there are no old data layer scripts remaining in the checkout process. This includes reviewing the Additional Scripts section and ensuring that any references to the old data layer or related scripts are removed. By updating these settings, you ensure that your checkout process is free from outdated configurations and that the new data layer is properly integrated throughout your store.



Once you’ve completed these steps, your store should be ready to work seamlessly with our app

If you see tracking data not updating, ensure you removed the snippets from both the head and body sections

Updated on: 06/02/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!