How to Upgrade Data Layer Customizations to be Compatible with Custom Pixel
Overview
If you have previously applied customizations to your purchase event or the data layer to add or overwrite a field, you will need to add these customizations to the Custom Pixel you will create as part of the Custom Pixel Upgrade.
How Do I Know if I Have Customized My Data Layer?
Below are some common example scenarios where a merchant has customized the existing Elevar Data Layer:
Example #1:
- You have directly edited the Shopify liquid in an Elevar snippet to pass your own unique product identifier in the
product_id
field of Elevar'sdl_view_item
,dl_add_to_cart
,dl_begin_checkout
, anddl_purchase
events.
Example #2:
- You are pushing your own custom Data Layer event before Elevar's
dl_add_to_cart
event, and your custom event includes a newproduct_color
field which (because it fired first) is available in Elevar'sdl_add_to_cart
event in GTM. This means that all your GTM "Add to Cart" tags include this newproduct_color
property, which can be sent to destinations client-side.
Example #3:
- You are transforming our pre-built Data Layer events via the officially supported utility. You will see a
window.ElevarTransformFn
function defined in your Shopify Theme.
Example #4:
- You are using your own user identifier to re-identify shoppers coming back to your website. You will see a
window.ElevarUserIdFn
function defined in your Shopify Theme.
Add to the Custom Pixel
- The customization code you've previously written for your order status scripts or a theme snippet, as documented here, should be added to you custom pixel you'll create as a part of the upgrade process. Follow the instructions for the custom pixel.
Note: You have likely wrapped your script with
\<script\>
tags, these should be removed when added to the custom pixel because the Shopify pixels only allow JavaScript.
Updated 3 months ago