Visitor identification using AppMeasurement

AppMeasurement is Adobe Analytics’ legacy JavaScript library for data collection. While AppMeasurement by itself offers a native way to identify visitors, many modern browsers reject the cookies that it attempts to set. Adobe strongly recommends using the Adobe 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.

Use this section to create a basic integration between Adobe Analytics and the Visitor ID Service. Ensure that you are prepared with the following:

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

  • A development Report suite ID.

  • The desired domain for trackingServerSecure.

  • Your IMS org ID:

    1. Log in to experience.adobe.com using your Adobe 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, see the following basic example page containing the minimum required calls to send data to Adobe 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@AdobeOrg"); // 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:
code language-js
s.prop1 = typeof(Visitor) != "undefined" ? "VisitorAPI Present" : "VisitorAPI Missing";
IMPORTANT
Adobe 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 practices, 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
Adobe 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.
    • Adobe does not offer any way to stitch hits using different visitor IDs together.
  • 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