Convert tracking calls

You must convert data layer on tracking calls if you are passing your third-party data layer object to your Tealium tracking calls.

Example:

utag.link({
    "event" : {
        "type": "cart",
        "name": "add to cart",
        "items" : [{
            "id": "prod123",
            "price": "123.45",
            "qty": "2"
        }]
    }
});

Add the extension

Use the following steps to convert data layer tracking calls:

  1. In the left sidebar, navigate to iQ Tag Management > Extensions.
  2. Add a JavaScript extension.
  3. In the Title field, enter Convert Tracking Calls.
  4. In the Draft Name field, enter a name for your draft.
  5. In the Scope field, select All Tags.
  6. Change the execution to Before Load Rules.
  7. Copy and paste the following code into the JavaScript field for the extension:
        teal.flattenObject(b,b);
    
  8. Click Approve for Publish.
  9. Select one or more publish environments and click Apply.
  10. Save and publish your changes.

Was this page helpful?

This page was last updated: January 7, 2023