Information for: DEVELOPERS   PARTNERS

captureIdentity - Acquia Lift JavaScript API

When capturing events, sometimes you may want to directly send additional identifying visitor information to Acquia Lift — for example, the website visitor’s email address, social media username, or an identifier from another system (such as a subscriber ID).

Note for Drupal users

You can install and use the Drupal modules on your website to send identifying information to Acquia Lift, including registration and login events and the corresponding email address of a website visitor.

Although you can use functions in the JavaScript API to capture these items, Acquia Lift includes a special identity method that collects this information into a single array of values.

To send a website visitor’s identity information directly to Acquia Lift, use the following JavaScript code:

<script>
_tcaq.push(['captureIdentity', '<value>', '<identity-type>']);
</script>

Modify the example based on your website’s needs by replacing the following variables:

  • <value> - The value that you want to assign to a subparameter

  • <identity-type> - An information type that you can populate with a visitor-specific value

    Select from the following identity types for your use:

    Identity type Description
    email Email address
    account Account ID, possibly an identifier from another tracking system
    facebook Facebook username
    twitter Twitter username
    name Name, including first, middle, last, or any combination of these
    custom identifier Customized visitor-specific information that you want Acquia Lift to treat as an identifier, such as subscriber ID

Sending additional parameters with captureIdentity

You can send additional information as parameters using the captureIdentity method, which is similar to other Acquia Lift Web capture methods. To do this, send your parameters based on the following example:

_tcaq.push(['captureIdentity', '<value-identity>', '<identity-type>', {'<parameter>':'<value-param>'}]);

Because the captureIdentity method supports sending only a single identity subparameter, you can also add identity as a special type parameter to your captureIdentity method, allowing you to send multiple identity values to Acquia Lift.

_tcaq.push(['captureIdentity', '<value-identity>', '<identity-type>', {'<parameter>':'<value-param>'}, {'identity':{'<value-identity-2>':'<identity-type-2>'}}]);

Note

If you are not sending any parameters with a capture event, but are using identity as a parameter, be sure to include {} for the empty list of regular parameters.

The following example sends a website visitor’s name and email address using a single JavaScript capture instruction:

_tcaq.push(['captureIdentity', '[email protected]', 'email', {}, {'identity':{'John':'name'}}]);

Sending identity values with other capture methods

If you want to send website visitor identity information that’s associated with a website event (such as a registration event), you can use the identity method as a parameter in the JavaScript event capture code. The following example captures a page view with an event category of Technology along with the website visitor’s email address:

_tcaq.push(['capture', 'Technology', {}, {'identity':{'[email protected]':'email'}}]);