Trace

Trace

by on ‎03-03-2016 02:17 PM - edited 3 weeks ago by Community Manager (1,428 Views)

The trace feature allows you to retrieve a Trace ID from the system, start and stop a new trace, join an active trace, and view the overview panel and trace log in real time.

This article covers the following topics:

Table of Contents Placeholder

Prerequisites

The following items are required to use the trace feature:

How It Works

Trace provides the necessary tools to test your Universal Data Hub (UDH) configuration and view your data in real time, providing an overview of what is working and what needs to be adjusted. Using trace, you can observe the detail of a predefined workflow, ensure attributes update correctly, rules are applied, and actions trigger as expected.

From the trace log interface, you can:

  • View predefined workflows and event log details in real time
  • Start or stop a trace
  • Join an active trace
  • Establish rules and view results
  • Get replay code to replay, pause, or resume an event
  • View a scrolling summary of actions, events, and audiences
  • Use the one-click slide to view the details of an event
  • View snapshots of visitor profiles

Getting a Trace ID

Once you have saved your UDH configuration and are ready to begin testing your enrichments, audiences, and actions, you need to get a Trace ID to use in the Trace tool.

Use the following steps to get a Trace ID:

  1. Navigate to Discover > Trace.

  2. Click Start Trace.

  3. Copy the Trace ID number.

    TRACE CARD 2 New2 Trace or Join Trace.png
  4. Click Continue.

Starting a Trace

Once you have a Trace ID, you can open another browser window and start the trace. Any active traces must be exited before you can open a new trace.

Use the following steps to start a trace:

  1. Open a new Chrome browser window or tab and navigate to the first page of the workflow to test.

  2. Open the Tealium Tools browser plugin and click AudienceStream Trace.

    TRACE_DOC_Tealium_Tools_Click_AudienceStream_Trace.png
  3. Paste or enter the Trace ID number.
    Uncheck Trace me as a new visitor if you are tracing a session across multiple domains.

    TRACE_DOC_Tealium_Tools_Start_Trace.png
  4. Click Start Trace.

  5. Return to UDH, where you got the Trace ID, and click Continue.
    As you navigate through your workflow in one browser window, trace sends information back to UDH and displays a timeline of visitor activity.

Replaying Trace Events from the Overview Panel

From the overview panel, you can replay, pause, or resume an event, as shown in the following table. You can also save time repeating tasks by getting code to replay events and reusing the configuration settings for a different Trace ID.

TRACE Expanded Player Menu.png
  • Replaying the Trace at Normal or 2x Speed
    The default setting used to replay an event is normal speed. To speed up the replay, select the double arrows to replay the event at two times the speed.
  • Pausing the Trace
    The pause button allows you to pause the replay of an ongoing trace. When paused, trace continues to process new events behind the scenes but does not display new log entries until you click pause again to restart.
  • Exiting the Current Trace
    Clicking the X will exit the current trace. If the trace is still active on the web page, the user can rejoin the trace using the Trace ID.
  • Viewing the Latest Visitor Profile
    Clicking the icon to view the latest visitor profile displays the a snapshot of the profile for the latest visitor in JSON format, as shown in the following example:
    Trace Card 2 NEW.png
  • Get Code to Replay Events
    Clicking the Get Code to Replay Events button </> generates a curl command for each event. Using this command, you can repeat or replay an even in trace without having to recreate the configuration steps on the web page.
    • To replay a single event, copy and paste the matching curl command in the terminal application and press Enter to run the command.
    • To replay multiple events, click Download Bash Script to download the .sh file. Use the terminal application to run the .sh script.

Viewing Event Details

The following image illustrates the parts of the trace interface. The Trace Log is a real-time scrolling summary of actions, events, and audiences. The top section is called the Overview Panel and displays a snapshot of the detailed activity. Filters can be used to filter and sort attributes.

TRACE CARD 26b Event Stream Start to Finish (2).png

The left side of the screen is used to filter attributes and values. No event attributes are displayed in the left filter, this filter only displays visitor and visitor-scoped attributes. Use the Filter by: drop-down list to choose how you want to view the attributes and their values. Filtering allows you to examine if the attributes and the configurations tied to them are functioning properly. Attributes and their values can be filtered by one of the following:

  • All
    Shows all attribute types and values set up in your AudienceStream profile.
  • Existing
    Shows only the attributes that acquired a value after AudienceStream processing.
  • Modified
    Shows only the modified, or enriched, attributes.

In the trace log, clickable text displays in white font, other text displays in gray. The timestamp adjacent to the log entry displays the time of the log entry. To view the details of an event, simply click an icon next to an event to slide out a detailed view of the event.

Clicking on an attribute or rule in the sliding panel will end the trace and cause you to exit the trace log.

Stopping a Trace

Use the following steps to end an active Trace and associated visitor session.

  1. Open a new Chrome browser window or tab and navigate to your site.

  2. Open the Tealium Tools browser plugin and click AudienceStream Trace.

  3. Verify the Current Domain and Current Trace Id of the trace you want to stop.

  4. Click Stop Trace.

Joining an Active Trace

Use the following steps to join a trace that is currently in progress:

You must exit any active traces before you can join a trace. 

  1. Go to Discover > Trace.

  2. Enter the known Trace ID for an active trace.

  3. Under Join Trace, click Join.
    This step redirects you to the corresponding trace in progress.

    Trace Card 2 NEW.png

Manually Starting a Trace from the Browser Console

If you do not use Chrome or cannot use the Tealium Tools plugin, you can manually start a trace using your  browser developer tools. The trace tool uses a manually-created cookie called "trace_id".

Traces started manually will always follow the "Trace me as a new visitor" feature.

 Use the following steps to start a trace manually:

  1. Open a new Chrome browser window or tab and navigate to the first page of the workflow to test.

  2. Open your developer tools or the web console for your browser.

  3. Enter the following line of code to enable the traced_id cookie.
    Replace the variable "12345" with the Trace ID number from UDH.

    document.cookie="trace_id=12345;path=/";
  4. Reload the page to begin the trace.

Manually Ending a Trace from the Browser Console

Use the following steps to end a trace manually:

  1. Open a new Chrome browser window or tab.

  2. Open your developer tools or the web console for your browser.

  3. Enter the following line of code to trigger the event and delete the trace_id cookie:

    console.log("Attempting to kill visitor session for Trace."),window.utag&&utag.track?utag.track("kill_visitor_session",{event:"kill_visitor_session","cp.trace_id":utag.data["cp.trace_id"]}):console.log("Unable to kill visitor session using utag.track.");

Starting a Trace from an App

This procedure uses the Charles Web Debugging Proxy (Charles Proxy) to start a trace from an application using the Mobile SDK and the collect tag.

Use the following steps to start the trace using the Charles proxy:

  1. Set up your mobile device to proxy traffic on your computer to Charles on your computer.
    In this step, follow the iOS or Android instructions.

  2. Run your application using Charles as the Proxy and filter the network traffic in Charles for "teal".
    A request similar to the following displays:

    TRACE Charles Proxy Steps 01.png
  3. Right-click the request and select Copy URL.

  4. From the Charles menu, click Tools > Rewrite.

  5. Click Enable Rewrite.

  6. In the Name field, type Add Trace ID.

  7. Click Add to add a location.

    TRACE Charles Proxy Step 02.png
  8. In the Host field, type or paste the URL for the collect tag.
  9. Click outside of the Edit Location dialog box.
    Charles automatically determines the additional components of the URL, resulting in a screen similar to the following:

    TRACE Charles Proxy Steps 03.png
  10. Ensure that the query parameters are empty and remove any existing text in the Query field.

  11. Click OK.

  12. Click Add from Actions list in the Rewrite Settings dialog.

    TRACE Charles Proxy Steps 04.png
  13. In the Rewrite Settings dialog, configure the settings to match the following example:

    TRACE Charles Proxy Steps 05.png
  14. In the Type field, select Body from the drop-down list.

  15. Under Where, click to select the Request checkbox.

  16. In the Value field under Match, enter the following:

    "data":{
  17. Click to select the Match whole value checkbox.

  18. In the Value field under Replace, enter the following:

    "data":{"cp.trace_id":"12345",

    In this step, use your actual trace ID instead of 12345.

  19. Click to select the Replace first checkbox.
  20. The steps are now complete.
    You can now browse your application and view the requests in the AudienceStream trace session.

  21. Charles retains the settings from your last setup, you do not have to do these steps each time you want to trace. To run another trace, simply start Charles, edit the existing rewrite rule to change the 12345 value of the trace id.