HubSpot Lookup Variable for Server-Side GTM

This variable template retrieves contact information from the HubSpot CRM Contact API. It allows you to dynamically enrich your server-side event data with valuable customer properties directly from your HubSpot account.

Features

  • Direct CRM Integration: Queries the HubSpot CRM API to fetch up-to-date user data based on unique identifiers like Email or Contact ID.

  • Built-in Caching: Utilizes Server-Side GTM’s templateDataStorage to cache responses, preventing redundant API calls for the same user and protecting your HubSpot API quota.

  • Flexible Output: Extract the entire contact object or strictly filter for specific properties (e.g., firstname, phone).

Configuration

HubSpot Authentication

  • Access Token: Use your HubSpot Private App Access Token or Service Key.

    Ensure it has the crm.objects.contacts.read permission.

    For more information on how to get your token, check the documentation: Private App Access Token or for Service Key.

Lookup Parameters

  • Identifier Choice: Choose the key used to look up the user in HubSpot. Options include:

    • Email
    • Contact ID
    • Other unique identifier (Allows you to specify a custom key)
  • Identifier Value: The dynamic value (usually an Event Data variable) to search for.

  • Properties to Retrieve (Optional): A list of contact properties to return from HubSpot (e.g., email, firstname, lastname, phone).

Output Format

  • Return entire object: The variable will return the complete response object provided by HubSpot.
  • Return custom properties: Allows you to define a list of properties. The variable will return a clean object containing only those specific properties. If only one property is defined, it will return its string value directly.

Open Source

Hubspot Lookup Variable for Google Tag Manager Server Container is developed and maintained by Stape Team under the Apache 2.0 license.

GTM Gallery Status

:red_circle: Not listed

GitHub

:green_circle: Repository

stape-io/hubspot-lookup-variable — updated: view commit

  • Added HubSpot Lookup template to retrieve contact data from HubSpot CRM Contact API
  • Supports lookup by Email, Contact ID, or custom unique identifier
  • Allows specifying custom properties to retrieve or return the full contact object
  • Implements response caching with configurable expiration time
  • Includes built-in authorization via HubSpot Private App Access Token or Service Key

GTM Gallery Status

:red_circle: Not listed