Set up the data layer converter

The data layer converter is added to your account by pasting JavaScript code into an extension and then adjusting parts of the code to accommodate your specific data layer conversion.

The added functionality is used in one of the following methods (or both):

  • Convert Page Data Object
    Convert the source data object to the Universal Data Object (utag_data) on every page load.
  • Convert Tracking Calls
    Convert the source data object on every call to utag.view() and utag.link() .

Copy the code

tealium_data_layer_converter_v1.4.js

Add the extensions

Use the following steps to add the data layer converter code:

  1. In the left sidebar, navigate to iQ Tag Management > Extensions.
  2. Add a JavaScript Code extension.
  3. In the Title field, enter Data Layer Converter.
  4. In the Scope field, select Pre Loader.
  5. In the Draft Name field, enter a name for your draft.
  6. Paste the copied code into the JavaScript field for the extension.
    Data Layer Converter_Add JS Extension.jpg
  7. Click Approve for Publish and select the targets.

Use the following steps to add the code to trigger the data layer converter:

  1. In the left sidebar, navigate to iQ Tag Management > Extensions.
  2. Add a JavaScript extension.
  3. In the Title field, enter Convert to utag_data.
  4. In the Scope field, select Pre Loader.
  5. In the Draft Name field, enter a name for your draft.
  6. Copy and paste the following code into the JavaScript field for the extension:
    utag_data = teal.flattenObject(digitalData);
    

Update digitalData to the name of your data layer object.

  1. Ensure that this extension is listed below the Data Layer Converter extension created in the previous step.
  2. Click Approve for Publish and select the targets.
  3. Select one or more publish environments and click Apply.
    TiQ_Data Layer Converter_Approve for Publish.jpg
  4. Save and publish your changes.

Was this page helpful?

This page was last updated: January 7, 2023