How to deploy custom events for HubSpot revenue attribution reporting

Bring off-platform interactions into revenue attribution reporting using HubSpot workflows and custom events.

Why custom events matter for revenue attribution

  • Default attribution reporting primarily considers on-platform marketing and sales interactions, but it can be configured to include custom events.
  • For revenue-influencing events that happen off-platform, custom events unlock accurate attribution.
  • HubSpot workflows can create custom events completions, connecting off-platform events to attribution.

Summary of the the custom events solution

What you'll need: to deploy this solution, you'll need custom events, which are available in any Enterprise tier of HubSpot's CRM platform and the webhooks action in workflows, which is available in Ops Hub Professional or Enterprise. You won't need specific coding knowledge, as everything will happen on HubSpot's platform using admin-addressable tools.

What to do:

  1. Create an API-type custom event connected to contacts
    1. Name it the primary term you want to see in attribution reports
    2. Include all standard fields
  2. Use a contact-based workflow to send webhook ‘post’ to events API
    1. Include record ID to identify the contact
    2. Include field values for attribution
  3. Use attribution settings and turn the new event for RAR

Documentation of the functionality this solution uses

Webhooks in Workflows:

Use webhooks with HubSpot workflows:

  • Set up a POST request

    • In your HubSpot account, navigate to Automations > Workflows.

    • In the workflow editor, click the + plus icon to add an action.

    • In the left panel, in the Data ops section, select Send a webhook.

  • Click the Method dropdown menu and select POST. 
  • Enter the webhook URL.
    • Webhook URLs are restricted to a secure protocol and must begin with HTTPS.
    • To request specific information, you can add query parameters such as ?queryparameter=abc to the Webhook URL.
    • If no query parameters have been added, a generic POST or GET request will be sent. 
  • Set up your authentication type to authenticate requests to your webhook. You can either use a request signature in your webhook header or use an API key:
    • To use a request signature in your webhook header: 
      • Click the Authentication type dropdown menu. Then, select Include request signature in header.
      • Then, enter your HubSpot App ID. Learn how to verify request signatures.
  • To use an API key or a public app created through a developer account for authentication:
  • When using an API key for authentication, the API key name and API key location used are dependent on how the webhook is configured. For security reasons, the API key will not display in any test requests. To use an API key: 
    • Click the Authentication type dropdown menu. Then, select API key. 
  • Enter your API key name.
  • Click the API key location dropdown menu. Then, select either Query parameters or Request header. Learn more about using API keys in HubSpot.
  • If you're making a request to HubSpot API's:
    • Click the API key dropdown menu and select a secret. The secret value must be in the format Bearer [YOUR_TOKEN].
    • Set the value of API key name to Authorization.
    • Set the value of API key location to Request Header.
  • To include all properties, select Include all [object] properties. 
  • To include only specific properties:

    • Select Customize request body.
    • To customize the request body using a HubSpot property, enter the Key and select a property. To add another property, click Add property.
    • To customize the request body using a static field, enter the Key and Value. To add another property, click Add static value.
  • To remove a property or static value, click the delete trash icon.
  • Click Save. 

Please note: to select multiple outputs, the response should be structured as a JSON object.

Developer Docs: Events & Attribution

HubSpot Developer Documentation: Custom Event Completions:

JavaScript events such as clicked element and visited URL events are automatically populated with asset type and interaction data for attribution reporting. To include the same data for manually tracked events, you'll need to manually include the data in the request body using event properties. Learn more about analyzing custom events.

Below, learn about the available values for asset types and interaction sources, along with example requests.

Properties to include in event completions for attribution inclusion:

{

"hs_asset_type": "",

"hs_asset_title": "",

"hs_touchpoint_source": ""

}

Video overview of this solution