Using Google Tag manager with Acquia Lift

When using Acquia Lift, you can use Google Tag Manager to instrument events, which can both provide more understanding and a better customized experience for your users.

Using the following framework (with its own example values), you can build an Acquia Lift event with Google Tag Manager. Modify any of the provided example names as appropriate for your application.

  1. Build an event that can be used for tracking purposes. In this example, we are using an event labeled as Add to Cart.
    1. Create an event.
    2. Enter values in the following fields:
      • Event name - Example value: Add to Cart
      • Event ID - This should auto-fill with the Event name, but can be modified
      • Customer Site - Either click the appropriate website, or click Global
      • Event type - Example value: Click Click
    3. Click Save to save the event.

    Creating an event

  2. To map retrieved information to users, you must next Add column metadata for the event to Profile Manager. The following image is an example of the event details:

    Profile manager column metadata

    For the column metadata in this example, use the following values:

    • Display Name - Product Name
    • Display Order - 1
    • Table - Event, for the Event table
    • Accessor - custom_field_1(getCustomField1) (be sure to note the number for this field)
    • Type - String
    • Description - Product name from Add to Cart
  3. Configure the Google Tag Manager to expose the product name in the data layer of your website. Configure a variable in Google Tag Manager to store the product name: product-name.
    For an explanation of Google Tag Manager configuration, see Tags, triggers, variables, and the data layer.

    Product name in GTM

    After configuring the variable, create a trigger that fires when a user clicks the Add to Cart button.

    Trigger configuration in GTM

  4. Create a custom HTML tag that captures the Add to Cart trigger, using the Acquia Lift JavaScript API method of capturing a page view. To do this, use code similar to the following:

          _tcaq.push(['capture', 'Add to Cart', { 'event_udf1':{{product-name}} }]);

    The event_udf number (event_udf1 in this example) must match the number chosen in the Accessor field mentioned previously. After embedding this code, whenever a user clicks the Add to Cart button on a product page, an event will be returned in Profile Manager as follows:

    Lift event example

    Other possible uses are to create triggers and events using the captureIdentity or updatePerson API functions.

Contact supportStill need assistance? Contact Acquia Support