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 toutag.view()
andutag.link()
.
Copy the code
Add the extensions
Use the following steps to add the data layer converter code:
- In the left sidebar, navigate to iQ Tag Management > Extensions.
- Add a JavaScript Code extension.
- In the Title field, enter
Data Layer Converter
. - In the Scope field, select Pre Loader.
- In the Draft Name field, enter a name for your draft.
- Paste the copied code into the JavaScript field for the extension.
- Click Approve for Publish and select the targets.
Use the following steps to add the code to trigger the data layer converter:
- In the left sidebar, navigate to iQ Tag Management > Extensions.
- Add a JavaScript extension.
- In the Title field, enter
Convert to utag_data
. - In the Scope field, select Pre Loader.
- In the Draft Name field, enter a name for your draft.
- 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.
- Ensure that this extension is listed below the Data Layer Converter extension created in the previous step.
- Click Approve for Publish and select the targets.
- Select one or more publish environments and click Apply.
- Save and publish your changes.
This page was last updated: May 24, 2023