This article provides detailed steps to create a visitor ID attribute. This example uses
customer_id, which is typically available when a visitor makes a purchase, as a user identifier.
Learn more about Anonymous ID and User Identifiers.
In this article:
To create a visitor ID attribute, first determine which event attribute is a good user identifier for your users. The value of the user identifier must be unique for each visitor. This example uses
customer_id as the user identifier. The user identifier is used to populate a visitor string attribute using a rule to match a qualifying event. This example uses the
purchase event. The visitor string attribute is used to verify that the user identifier is unique for each visitor. After the visitor string attribute is verified to be unique across visitors, it is used to populate a visitor ID attribute.
Before you create a visitor ID attribute, you must create a rule to specify when the value is assigned to a visitor ID attribute.
Use the following steps to create a rule to set the visitor ID attribute to
customer_id is assigned and the value is not "none".
customer_idfor the attribute and is assigned from the operator drop-down list.
customer_idfor the attribute, select does not equal (ignore case) for the operator, enter "none" for the value, then press Enter to confirm.
Create a temporary string attribute to use for verification in Audience Discovery. If you create a visitor ID attribute without verifying data, you risk improperly stitching visitor profiles.
Use the following steps to create a string attribute:
customer_idfor Set String to.
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 to wait before you can verify the data in AudienceStream.
If you are using a first-party cookie that is available for every visitor, data should appear within 15 minutes.
To verify that the chosen attribute is unique, use Audience Discovery to view the distribution of the attribute's values across your active visitors. For more information, see Audience DIscovery.
Bad Visitor String Attribute
A bad visitor string attribute would be one where there are hundreds of users with the same value. If stitching was enabled, all these users would all be combined into a single visitor profile, which is obviously incorrect.
For example, if you see multiple instances of "unknown", you can add conditions to the rule to exclude those instances. If there are many visitors with the same value for the visitor string attribute, choose a different user identifier to populate the string attribute and verify the results again.
Good Visitor String Attribute
In the case of a good visitor string attribute, only a small sample of users would have the same value. There may be multiple users with a value of "none", which is normal because not every visitor has a value. It may be difficult to determine why visitors have the same value. When less than 1% of the visitors have two visitors assigned the same visitor string attribute, it is OK to use the chosen user identifier to populate a visitor ID attribute and enable visitor stitching.
After you verify that you have a good visitor string attribute, create a visitor ID attribute. Set the visitor ID to the string attribute used for verification, and select the newly created rule. Save and publish to production to start recording data.
After you create the visitor ID attribute, visit the Support Desk to request that visitor stitching be enabled for your account.
After the configuration is live, an example of stitching occurs as follows: