javascripttaggingtealium

Tealium tagging for errors while loading of the page


I am just very new to Tealium tagging and I want to use the tags whenever an error comes at the loading of a page.

I am using subscribe-publish for showing the error on screen. Now I want to send the error information for analytics purpose everytime an error comes.

Want to send info like error type, page name, site name etc.

Can you please help how to have this implemented using tealium? Please start the explanation from the very basics as I am literally just a beginner :P

Thanks in advance.


Solution

  • First, the asynchronous Tealium script would need to be included on the page.

    Create the UDOs for each of the elements you're planning to capture information about (e.g. "error_type", "page_name", "site_name", etc) and consider adding some friendly aliases. These will be the values you need to populate the data layer with when such an error occurs. At this point, assuming you're using the default data layer name of "utag_data", your page will need to have the following JavaScript in the data layer object on the page before the Tealium script is referenced:

    utag_data = {
      "page_name": "my webpage",
      "error_type": "bad request",
      "site_name": "my website"
    }
    

    Add a tag for the analytics solution you wish to use and set up the appropriate dimensions/variables you wish to store the information within. This usually involves opening the mapping control within the tag, picking the variable you wish to store the information in and mapping it to your UDO that you created previously. Ensure that any analytics-side mapping is done as well since you may need to explicitly define what sort of information you're sending in.

    At this point, you just need to save and publish to the environment you're planning to capture the data within (though testing in a staging environment is a good idea too). When you visit the page and there's an error, assuming you did the above, you should see the network request in your browser's developer tools going to the analytics system with the data you provided.