Capture the Heap Session ID and User ID in your Invoca Tag, then use a custom post-call webhook to send call data and Signals to Heap.Integrate Invoca call data and Signals with Heap using the Invoca Custom Webhook feature and Heap’s Track (server-side) API.
Before you begin
Two prerequisites require a Heap Technical Resource:- Enable the Invoca Tag to retrieve the Heap Session ID and User ID from the dataLayer — typically via
heap.getSessionId()and theheap.userIdvariable. - Configure your Heap platform to accept two additional parameters in the Track server-side API — user_id and session_id — passed dynamically in the API call.
Steps
- Create two new Marketing Data fields:
heap_userIDandheap_getSessionId. - Create a new draft of your Invoca Tag to extract these values from the dataLayer, using the commands your Heap Technical Resource confirmed. Test using the Test button with
?invoca_rev=draftappended to your website URL, then call the phone number on the page to confirm the data was captured accurately. - Once the Heap User ID and Session ID are appending correctly to calls, create a custom webhook to send this data to Heap:
- Go to Integrations in the sidebar, then Custom Webhooks.
- Click New Webhook, and choose Post-Call.
- Name it descriptively (for example, “Heap”).
- Set the method to POST and enter the Heap Track (server-side) API endpoint as the URL.
- Set Content-Type to JSON and add your JSON body request, using “Add Substitute Parameter < >” for dynamic values.
- Under Firing Conditions, set Fire On to “All call-related transactions.”
- Save your configuration.
- Test by calling an Invoca number from your website and confirming the Heap IDs are captured and passed through the new webhook.