51ºÚÁϲ»´òìÈ

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.

Ensure that you are prepared with the following:

  • Download the . The downloaded library includes both AppMeasurement.js and VisitorAPI.js.

  • A development Report suite ID.

  • The desired edge domain for trackingServerSecure.

  • Your IMS org ID:

    1. Log in to using your 51ºÚÁϲ»´òìÈ ID credentials.
    2. Anywhere in the Experience Cloud interface, press [Cmd] + [I] (iOS) or [Ctrl] + [I] (Windows).
    3. A User data debugger appears. Select the Assigned orgs tab.
    4. Expand the desired IMS organization.
    5. 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>
TIP
You can track if a hit uses the Visitor ID service by assigning the presence of Visitor to a custom variable in doPlugins:
code language-js
s.doPlugins = function() {
  s.prop1 = typeof(Visitor) != "undefined" ? "VisitorAPI present" : "VisitorAPI missing";
};
IMPORTANT
51ºÚÁϲ»´òìÈ advises against using this method to identify visitors.

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_vi cookies first-party.
  • If you do not participate in the managed certificate program, tracking server is typically a subdomain of adobedc.net, omtrdc.net, or 2o7.net, making the s_vi cookie 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.

IMPORTANT
51ºÚÁϲ»´òìÈ advises against using this method to identify visitors.

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 visitorID value to be counted as a single visitor.

    • Any hits that omit visitorID automatically attempt to use another visitor identification method, treating them as a separate visitor.
    • Any hits that contain a different visitorID value 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.
  • Shared audiences, Analytics for Target, and Customer attributes are not supported with visitors identified using visitorID.

See visitorID for implementation instructions using this variable.

recommendation-more-help
b4f6d761-4a8b-4322-b801-c85b9e3be690