Loading...

Using the WebTag service

This page provides instructions on how to integrate Acquia as a first-party domain with your website for the following scenario:

  • IT technicians want to use the webtag script to seamlessly integrate Acquia and capture visitor behavior traffic for CDP. 

IT technicians can use the following tasks to set up a service user with a protected token, securely send data to CDP, accomplish marketing strategy campaigns, and generate insightful analytics reports.

The following diagram depicts the process flow for using the webtag service:

The following checklist lists the tasks for using the webtag service:

Creating a user role by setting up an instance

  1. Click Integrations > Instances.

    If the Instances tab is not visible, your account does not have the required role. To get access, contact your CDP administrator.

  2. Click Add Instance.

    The system displays the Create Instance page.

  3. In Name, enter the name for your instance.

    For example, Acquia_API_Webtag.

  4. In the Instance Type field, select DW Tracker to push upstream payloads from a source system to CDP.

  5. Click Save.

    The system system creates the instance and auto-populates values in the following fields:

    • API Host URL

    • Authentication Host URL

    • UserName

    • Password

    If you forget your tracker password, regenerate the credentials and ensure that they are not used elsewhere.

  6. Take a backup of the following credentials at a secure location as you cannot view them in the system again:

    •  Authentication Host URL
    • UserName

    • Password

    These credentials are used when creating a user role through Postman.

Creating a Token Retrieve request using Postman

Complete the following steps to create a Token Retrieve request using Postman:

  1. Set up Postman
  2. Set up the authentication request
  3. Set up the Token Retrieve request

Setting up Postman

  1. Download and open Postman.

  2. Click Create Collection.

  3. Click the Ellipsis icon, click Rename, and then rename the folder collection to CDP Authentication.

Setting up the authentication request

  1. In the CDP Authentication collection, click Add a request.

  2. Click the Ellipsis icon, click Rename, and then rename the request to Step 1 - Authenticate with Username and Password (One Time).
  3. Change the request to POST.

  4. Modify the endpoint URL parameter of the Authentication mechanism from /authentication to /token.

  5. Enter the following in Query Params to be added to the URL:

    • Key: scheme, Value: a1webtag
    • Key: action, Value: create

    The system adds the parameters to the URL:

    https://auth.agilone.com/token?scheme=a1webtag&action=create

    The following are the URL parameters:

    Cloud RegionURL EndpointParameter Description
    AWSauth.agilone.com
    • /token indicates the path that directs the request to the server's token management or generation resource.

    • ? indicates the beginning of the query string, which contains the parameters.

    • scheme=a1webtag specifies the authentication scheme, indicating to the server that the request follows the a1webtag protocol, which might affect token generation or permissions.

    • & allows addition of multiple key-value pairs to the query string.

    • action=create indicates a request for the server to generate a new valid token, staying within the unclaimed token limit for the specified a1user scheme.

  6. Click the Authorization tab and select the Type as Basic Auth.

  7. Enter the username and password.

    Postman recommends that you save all sensitive information into variables. For more information, visit Store and reuse values using variables. If you cannot set up variables, delete the sensitive information and re-enter the credentials each time you need, so that you can conduct tests to avoid security risks.

  8. Click the Headers tab.

  9. Add Key as Content-Type and Value as application/json.

  10. Click Save and click Send.

    For successful requests, Postman displays Status: 200 OK and access_token.

    You can initiate the user authentication step only after creating a token. You can use the token until it expires. You must not resend the request for continued testing with the generated token.

Setting up the Token Retrieve request

  1. Click the Ellipsis icon and click Duplicate to make a copy of the Step 1 - Authenticate with Username and Password (One Time) authentication request.

  2. Click the Ellipsis icon, click Rename, and rename the copy of the authentication request to Step 2 - Create Access Token (Once at Time).
  3. Change the request to GET.

  4. Click the Authorization tab and select the Type as Basic Auth.

    If the request was duplicated correctly, it must already be pre-populated. Postman recommends that you save all sensitive information into variables. For more information, visit Store and reuse values using variables. If you cannot set up variables, delete the sensitive information and re-enter the credentials each time you need, so that you can conduct tests to avoid security risks.

  5. Click the Headers tab.

  6. Add Key as Content-Type and Value as application/x-www-form-urlencoded.

  7. Click Save and click Send.

    For successful requests, Postman displays Status: 200 OK and access_token.

    Ensure to check the expiration date of the token on a regular cadence through GET request calls. The expires_in field in the response body indicates the lifespan of the token. By default, tokens last 90 days in Customer Sandbox (CS) and 180 days in UAT and Production (PROD) environments.

The response body consists of the following parameters:

ParameterDescription
access_tokenA unique string that serves as a token for accessing protected resources. In this case, "f265e508-c599-44e3-ab60-60a040a9154a" is the token that the API returns. You must include this token in the header of subsequent requests to access authorized resources.
token_typeThe type of token that is issued by the server. In this example, the token type is "bearer", which means that the bearer of this token has the authorization to access the resources. Bearer tokens are a common method used in OAuth 2.0 for accessing resources.
expires_inThe lifetime of the access token in seconds. Once this time elapses, the token expires and no longer grants access. In this case, 15600000 seconds means the token has a significant duration before expiration.

Validating data in CDP

Use the following procedure to validate data integration in CDP:

  1. Sign in to your CDP user interface.
  2. Navigate to Interactive Queries > Queries.
  3. Click Create to initiate a new query.
  4. In the left panel, check the list of entities.

    This list enables API data validation for real time custom events using zone.datavalidation.dw_real-time_<name entity>.

Querying entities

Query each entity individually or combine them based on the validation requirements.

Example: Querying individual real-time entities

-- Customer entity
SELECT * 
FROM zone_datavalidation.dw_realtime_customer;
-- Event entity
SELECT * 
FROM zone_datavalidation.dw_realtime_event;

Example: Combining real-time entities

SELECT 
    customer.*, 
    event.*, 
    TO_VARCHAR(TO_TIMESTAMP_NTZ(event.EventTimestamp / 1000), 'MM.DD.YYYY') AS WebTagDate
FROM zone_datavalidation.dw_realtime_customer AS customer
LEFT JOIN zone_datavalidation.dw_realtime_event AS event
ON customer.id = event.customerid
LIMIT 1

Users format a view based on the real-time validations required for reviewing the dataset delivered from your website.

Refer to CDP referential integrity IDs to understand the primary key relationships used for table joins. This step helps to validate how entity fields align with upstream data mappings.

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Back to Section navigation