Like any script, Heap can be installed via Google Tag Manager, or GTM for short. Because of the way GTM works, we strongly recommend setting the highest priority for Heap to be loaded.
To install, add the Heap snippet as a custom HTML tag and set it to fire on All Pages.
If you have not yet installed Heap, you’ll find your snippet on our install page. If using the snippet above, remember to replace
YOUR_APP_IDwith the ID of the environment to which you want to send data. You can find this ID on the Account > Manage > Projects page.
GTM waits until the page fully loads to load its scripts. So if a user navigates away from the page before Heap loads, that data point will be lost. If you are using our client-side API, calls that are normally stubbed before the page loads, like calls to identify or addEventProperties, can get dropped.
Not seeing any data?
Make sure you published the container after saving the trigger. If you continue to experience issues after saving, reach out to [email protected].
Encountering a "heap.push is not a function" error?
Make sure that the Heap script is only getting loaded once. You may have to configure the tag to fire only "Once per page" in the tag's advanced settings.
Updated 13 days ago