Visitor stitching is a form of identity resolution that works across platforms, devices, and browsers to associate activity to the same visitor. This article describes the different forms of identity resolution, how stitching works, and how to use the visitor ID attribute effectively.

In this article:

Table of Contents Placeholder


Identity resolution is the process of identifying a user of your brand across multiple sites, apps, and touch-points to create a complete profile of their activity. Tealium accomplishes this using a primary identifier and one or more secondary identifiers.

A primary identifier is a unique and anonymous value assigned to a user upon each engagement with your site or app. Tealium Collect, which sends data to Tealium EventStream and AudienceStream, generates this primary identifier and stores it in a first-party cookie named utag_main_v_id . While this works great to keep track of a user within the same browser or app, it won't be consistent across different browsers or devices. This is where secondary identifiers come in.

Secondary identifiers are unique values that identify the same user across browsers, devices, and platforms. These values can come from first-party data or third-party data, but it must be obtained consistently on any platform. Examples of secondary identifiers include a hashed email address, a customer ID from your internal system, or a social media ID from Facebook or Twitter. In AudienceStream these secondary identifiers are set using the Visitor ID attribute.

To support inter-browser, cross-platform, and cross-device identity resolution, AudienceStream uses a feature called visitor stitching. Visitor stitching relies on both the primary identifier and secondary identifiers to combine all user sessions into a single visitor profile in AudienceStream.

Here is an example to show how visitor stitching works across two devices for an unknown user that eventually registers. The user browses many pages and searches for many items from both a laptop and from a mobile phone. The user registers on the laptop then logs into that account on the mobile phone.

Laptop Activity Mobile Phone Activity

Primary Identifier: ABC123

AudienceStream Visitor:

"ID": "ABC123",
"Page Views": 18,
"Searches": 2

Primary Identifier: DEF456

AudienceStream Visitor:

"ID": DEF456",
"Page Views": 24,
"Searches": 6
Activity: User Registers on Laptop

Primary Identifier: ABC123

Secondary Identifier (hashed email): 05fcf31275aa13408ace62e84dac60ae4b805a65

AudienceStream Visitor:

"ID": "ABC123",
"Email" : "05fcf31275aa13408ace62e84dac60ae4b805a65",
"Page Views": 18,
"Searches": 2
No change.
Activity: User Logs In on Mobile Phone (stitching occurs)

Stitched Visitor

Primary Identifier: ABC123

Secondary Identifier (hashed email): 05fcf31275aa13408ace62e84dac60ae4b805a65

AudienceStream Visitor:

"ID": "ABC123",
"Hashed Email": "05fcf31275aa13408ace62e84dac60ae4b805a65"
"Page Views": 42,
"Searches": 8,
"Stitched IDs": [

Visitor stitching can only be enabled by Tealium Support. Visit Support Desk to request that visitor stitching be enabled for your profile.

Important Notes

Here are some important notes about secondary identifiers and visitor stitching:

  • Uniqueness
    A visitor ID must have at least 3 unique characters and be at least 6 characters long.
    Learn more about Visitor ID attribute requirements.
  • Case Sensitive
    Visitor ID values are case sensitive so, "" is different from "". If the attribute values contain these variations, use the lower-case enrichment to normalize them.
  • Multiple ID's
    Multiple Visitor IDs are evaluated as an OR condition.
  • Robustness
    We do not support anonymous identifiers while stitching - the IDs should be a guaranteed match to the visitor.
  • Master Visitor Profile
    When multiple visitor profiles are stitched, the original profiles remain and a new master visitor profile is created to combine the stitched profiles.
  • Avoid Test Data
    Be careful not to capture default or test values such as "unknown" or "not set".
  • Shared ID's
    Before stitching is enabled, determine how to handle shared IDs - such as those used at libraries or universities - so that multiple visitors won't be stitched inadvertently.

What is a Visitor ID?

The Visitor ID is a value that is used to identify a visitor. For example, a Visitor ID might be displayed as:  01477ea4d6880019373ccbeb040917051001e00f0093c.

While AudienceStream uses the utag_main_v_id cookie as the primary identifier, you can define many secondary identifiers using the visitor ID attribute. Secondary identifiers are more reliable because they usually come from first-party data and are unique and consistent for the life of the visitor. When a secondary identifier is available, Tealium AudienceStream will scan through past visitor sessions to stitch together those that belong to the known user.

Related article: Visitor ID Attribute


In this example, we will use the Facebook ID as a secondary visitor ID attribute which is made available when a visitor logs into a website using Gigya's consumer identity management platform.

Step 1: Store Secondary ID - Facebook ID

Using Gigya's service, the Facebook ID is made available to Tealium iQ Tag Management upon login to a website.

  1. Obtain the Facebook ID.
    WhiteUI_AudienceStream_UnderstandingVisitorStitching_Store Secondary ID.png
  2. Store the ID as a parameter of the utag_main cookie namespace.

Step 2: Create Rule

Before you create the new visitor ID attribute, you must create a rule to state when the attribute should be applied.

  1. In the sidebar, go to Server-Side Tools > Manage Rules.
  2. Click + Add Rule.
    The Create Rule dialog displays.
    WhiteUI_AudienceStream_UnderstandingVisitorStitching_Create Rule Dialog.png
  3. Enter the details that define when the Facebook ID is present.
    In this case, it's when the UDO cookie utag_main_fb_id exists (is assigned) and does not equal 0.
    • Title: Enter a title
    • Notes: (Optional) Enter meaningful notes about this rule.
  4. Click + Attribute Condition and select utag_main_fb_id from the drop-down list.
  5. Select is assigned from the operator drop-down list.
  6. Click + Attribute Condition to add another attribute for this rule.
  7. Select utag_main_fb_id from the drop-down list. and does not equal from the operator drop-down list.
  8. Select Use custom text and enter 0 in the space indicated and press Enter to confirm.
    WhiteUI_AudienceStream_UnderstandingVisitorStitching_Add Attributes to a Rule.png
  9. Click Save.
  10. Save and Publish your changes.

Step 3: Create String Attribute

Create a temporary attribute to use for verification. Use a string attribute at first (instead of a Visitor ID) so that you can verify the data in Audience Discovery and ensure that there are no issues with duplicate Visitor IDs. If you create a Visitor ID attribute without verifying data, you risk improperly stitching visitor profiles.

Use the following steps to set up this attribute:

  1. In the sidebar, go to AudienceStream> Visitor/Visit Attributes.
  2. Click + Add Attribute.
    The Add Attribute dialog displays.
  3. Under Choose a scope, click Visitor.
  4. Click Continue.
  5. Select String as the data type and click Continue.
  6. Under Properties, enter a title.
  7. (Optional) Enter meaningful notes.
  8. Click Finish.
  9. From the rule details, click the edit icon to apply the rule you created above.
  10. Click + Add Enrichment and select Set String.
  11. In the Set String to field, select utag_main_fb_id from the drop-down list.
  12. Under WHEN, select ANY EVENT from the drop-down list.
  13. Click Save.

Step 4: Publish to Production

Save and Publish the rule and attribute to production so that AudienceStream can start collecting the data. The number of users on the website and the type of data being collected will determine how long before you can verify the data in AudienceStream.

  • If you are using a first-party cookie that is available for every visitor, wait about 15 minutes and then verify.
  • If you are using a Facebook ID and only a small portion of visitors log in with Facebook, then some amount of data collection, from several hours up to a day, must occur before you'll be able to verify.

Step 5: Verify Data

In the sidebar, go to Facebook ID Exists and change the perspective of your view by selecting the newly created Facebook ID attribute.

Example of "Bad" Visitor ID

If there is a "bad" visitor ID, there could be hundreds of users with a Visitor ID of "0". With stitching was enabled, they would all be combined into a single visitor profile, which is obviously incorrect. To correct this, you can add a condition to the rule that is applied to the attribute and check that the value is not equal to "0".

Example of "Good" Visitor ID

In the case of a "good" Visitor ID, there could be several users with a value of "none". This is normal as not every visitor will have a Visitor ID. There is only a small sample of users that appear to have a duplicate ID. It is almost impossible to distinguish why thee IDs below may have 2 users assigned to them. It is; however, less than 1% of the population, so it is OK to enable Visitor Stitching.

Step 6: Create Visitor ID Attribute

Create a Visitor ID attribute that will get its value from the previous Facebook ID attribute create, give the Visitor ID attribute a title and note, and then apply the newly created rule. Save and publish to production to start recording data.

Step 7: Enable Visitor Stitching

Now that you've completed the appropriate verification of data, visit Support Desk to ask for Visitor Stitching to be enabled for the desired account/profile.

Use Trace to See It In Action

Once the configurations are live, an example of stitching occurs as follows:

  1. A visitor logs into the website on their work computer during lunch, using Facebook. Visitor profile "A" is created and captures the secondary Visitor ID. Eventually the session ends.
  2. The same visitor later logs into the website from their mobile device during dinner, using Facebook. Visitor profile "B" is created and captures the secondary Visitor ID.
  3. AudienceStream then performs the look-up to determine if the secondary Visitor ID from "B" exists in another visitor profile. When AudienceStream determines that profile "A" has the same Visitor ID, then visitor profiles "A" and "B" are stitched.

Data Enrichment

Once logged in with Facebook, two new data layer variables are created:["va._secondary_ids"] will exist with an array value of ["5435_1469626503"]["va.secondary_ids.5435"] will exist with a string value of "1469626503"

The "5435" in the attribute variable name is the ID assigned to the "Facebook ID" attribute within AudienceStream. You can find this number by viewing the attribute details within Tealium iQ where the UID is stated. Notice how the variable name uses "Secondary ID" to signify the connection to the master Visitor ID.

Tags (1)