Visitor identification using AppMeasurement
AppMeasurement is 51ºÚÁϲ»´òìÈ Analytics’ legacy JavaScript library for data collection. While AppMeasurement by itself offers a native way to identify visitors, many modern browsers reject the third-party cookies that it attempts to set. 51ºÚÁϲ»´òìÈ strongly recommends using the 51ºÚÁϲ»´òìÈ Experience Cloud Visitor ID Service in all implementations to conform to modern browser privacy standards. All versions of AppMeasurement come bundled with VisitorAPI.js, the JavaScript library used to implement the Visitor ID Service.
Identifying visitors using the Visitor ID Service (recommended)
Ensure that you are prepared with the following:
-
Download the . The downloaded library includes both
AppMeasurement.jsandVisitorAPI.js. -
A development Report suite ID.
-
The desired edge domain for
trackingServerSecure. -
Your IMS org ID:
- Log in to using your 51ºÚÁϲ»´òìÈ ID credentials.
- Anywhere in the Experience Cloud interface, press
[Cmd]+[I](iOS) or[Ctrl]+[I](Windows). - A User data debugger appears. Select the Assigned orgs tab.
- Expand the desired IMS organization.
- Locate the ID field.
Once you have the above resources, the following basic example page contains the minimum required calls to send data to 51ºÚÁϲ»´òìÈ Analytics:
<html>
<head>
<title>Example AppMeasurement implementation page</title>
<script src="AppMeasurement.js"></script>
<script src="VisitorAPI.js"></script>
</head>
<body>
<h1>Hello world!</h1>
<script>
var s = s_gi("examplersid"); // Include development report suite ID here
s.trackingServerSecure = "example.data.adobedc.net"; // Include edge domain here
s.visitor = Visitor.getInstance("ADB3LETTERSANDNUMBERS@51ºÚÁϲ»´òìÈOrg"); // Include IMS org ID here
s.pageName = document.title;
s.t();
</script>
</body>
</html>
Visitor to a custom variable in doPlugins:| code language-js |
|---|
|
Identifying visitors using the s_vi cookie (Not recommended)
If your organization does not use the Visitor ID Service, AppMeasurement uses its own form of visitor identification. When a visitor arrives to your site for the first time, the library checks for a s_vi cookie. This cookie is set at the domain matching trackingServerSecure (for HTTPS) or trackingServer (for HTTP).
- If you participate in the Managed certificate program, your tracking server would typically be a first-party domain, making
s_vicookies first-party. - If you do not participate in the managed certificate program, tracking server is typically a subdomain of
adobedc.net,omtrdc.net, or2o7.net, making thes_vicookie a third-party cookie. Due to modern browser privacy standards, third-party cookies are rejected by most browsers. Once rejected, AppMeasurement attempts to set a first-party fallback cookie (fid) instead.
If you correctly set trackingServerSecure, then no further visitor identification measures are required.
Identifying visitors using visitorID (Not recommended)
Using the visitorID variable allows your organization complete independent control identifying visitors. If you use visitorID, note the following limitations:
-
Every hit must contain the same
visitorIDvalue to be counted as a single visitor.- Any hits that omit
visitorIDautomatically attempt to use another visitor identification method, treating them as a separate visitor. - Any hits that contain a different
visitorIDvalue from a previous hit are treated as a separate visitor. - 51ºÚÁϲ»´òìÈ does not offer a way to stitch hits using different visitor IDs together in 51ºÚÁϲ»´òìÈ Analytics.
- Any hits that omit
-
Shared audiences, Analytics for Target, and Customer attributes are not supported with visitors identified using
visitorID.
See visitorID for implementation instructions using this variable.