Information for: DEVELOPERS   PARTNERS

updatePerson - Acquia Lift JavaScript API

Acquia Lift uses the updatePerson API function to update user-defined Person attributes without creating an Event record or updating the Touch record. The API function can be helpful when there is data from another source you want to append to the person profile, such as firmographic or demographic data. You can provide descriptive names for the attributes in Acquia Lift Web, which are then displayed in the visitor profile summary and the segment builder, using the Content metadata page.

Capturing person attributes

Add the following code to your webpage:

<script type="text/javascript">
_tcaq.push( ['updatePerson',
{'person_udf5':'attributedata1', 'person_udf6':'attributedata2', 'person_udf7': 'attributedata3' }
] );

where person_udf is a user-defined field for a person and attributedata is the information to add to the person. You can define up to 50 fields for values.

Acquia Lift captures the fields and associates them with the website visitor’s information.

When using an attribute containing a date, the date must display in the following format:


For example:


Example usage

The following example sets user-defined fields 5, 6, and 7 to firmographic values associated with the business the person works for—the company SMB, categorized as Retail, with 0-50 employees:

<script type="text/javascript">
_tcaq.push( ['updatePerson',
{'person_udf5':'SMB', 'person_udf6':'Retail', 'person_udf7': '0-50 employees' }
] );


Public _tcaq functions are only available after lift-capture.js is loaded on a page after personalization return. You will know lift-capture.js hasn’t loaded on a page if you receive the following reference error:

ReferenceError: _tcaq is not defined

Creating an updatePerson event with Google Tag Manager

You must track whether a user is a member of your website. Although not comprehensive, the acceptance criteria has two parts:

  • The user has clicked on a link from your Drupal website with the URL /user within it (the default route within Drupal for users to login).
  • You can segment those users in Acquia Lift.


  • The website has Acquia Lift installed.
  • The website has Google Tag Manager installed.
  • The website has a menu at the top with the User link, and the URL displays /user.

Create custom column metadata

  1. Sign in to your website as an administrative user.
  2. Go to Admin > Manage Configuration Data > Custom Column Metadata > Add new column metadata.
  3. Fill out the form with the following information, leaving the rest as default.
    • Display Name: Membership status
    • Display Order: 1
    • Table: Person
    • Accessor: custom_field_4
    • Type: String
    • Check Is Visible In Person Detail
    • Description: Membership status collected for the user
    • Operators: Matches and contains
    • Category: Person properties
    • Check Ignore Case When Comparing
  4. From the bottom of the form, save the new column metadata.
  5. The new column metadata displays in the form as shown in the following screenshot:

Custom Column Metadata

Create a trigger in Google Tag Manager

  1. Sign in to your Google Tag Manager account.
  2. Click Triggers.
  3. Click New.
  4. Name the trigger Login Click.
  5. Enter the trigger type: Clicks - Just Links.
  6. Configure This trigger fires on to Some Link Clicks.
  7. From under Fire this trigger when an Event occurs and all of these conditions are true, configure the variable to an auto-event variable using the Element URL containing user. You must create the auto-event variable.
  8. Save the Login Click trigger. Your trigger configuration will display like the following screenshot:

Login Click Trigger

Create a tag in Google Tag Manager

  1. Sign in to your Google Tag Manager account.

  2. Click Tags.

  3. Click New.

  4. Name the tag Update Person.

  5. Add a Custom HTML Tag.

  6. From the HTML tag editor, paste the following script:

    _tcaq.push(['updatePerson', {'person_udf4':'True'}]);


    The updatePerson tag can use any Lift API method.

  7. Under Triggering, click the checkbox and associate the Login Click trigger with the Update Person tag.

  8. Save the Update Person tag to display like the following screenshot:

Update Person Tag

Test the tag in Google Tag Manager

  1. Sign in to your Google Tag Manager account.
  2. Click Preview.
  3. Open your website where you will see the Google Tag Manager preview in the window.
  4. From the menu, Command click the /user login link which will open the login link in a new tab, leaving your Google Tag Manager preview intact.
  5. The Update Person tag will have fired, and will display in the Google Tag Manager Summary section under Tags Fired On This Page, as shown in the following screenshot:

Tags Fired On This Page

Test Acquia Lift received the data

  1. Before logging into Acquia Lift, grab the Acquia Lift tracking ID from your browser cookies.
    • In Chrome, you can Inspect, and then open Application > Cookies.
    • From Cookies, copy the tc_ptid for your website URL.
  2. Sign in to Acquia Lift, and from the People search field, paste the cookie tracking ID from the preceding step.
  3. Click your user, and open the Profile Details screen.
  4. You will see the Property Membership Status with a value of True for your user, as displayed in the following screenshot:

Membership Status True

You have now created Custom Column Meta Data in Acquia Lift, and have effectively used the Acquia Lift JavaScript API to capture added data.