Tracking users via Hull.js on your website is fairly easy; all you have to do is to install the hull.js snippet on your website. This can be done manually within the source of your site, or the snippet can be deployed via Google Tag Manager.
Add hull.js to your Hull account
First, navigate to your dashboard overview within Hull and select the "Add Platform" button at the bottom of the page.
From the Add Platform screen, you can assign a name for the platform, and define the domain(s) that you want hull.js to run on. Enter the primary URL where the snippet will run in the "Homepage" field. You can whitelist additional domains in the "Allowed domains" field.
When you're ready, click the "Install" button.
On the next screen, you can confirm or edit your options. Furthermore, you'll see the unique snippet that you'll need to use in order to install hull.js on your site.
Once you are satisfied with your settings, simply click "Save Changes."
Manually Install Snippet
To manually install hull.js, follow these simple steps.
- Copy your unique snippet from the newly created hull.js platform.
- Add your hull.js snippet to the <head> of your website.
Don't have access to your site's source code? Invite a teammate, such as a developer or site admin to join your Hull account that can help.
Install Snippet using Google Tag Manager
Navigate to your Workspace in Google Tag Manager, select tags and add a new Custom HTML Tag. Now get the snippet from your Platform in the Hull Dashboard and paste it into the HTML field in GTM:
The code snippet of the platform looks like the following:
<script id='hull-js-sdk' platform-id='123456a7b89012c3456789d0' org-url='https://demo.hullapp.io' src='https://js.hull.io/0.10.0/hull.js.gz' ></script>
In order to make it work in GTM, we have to adhere to strict HTML standard, so we have to prefix platform-id and org-url with data-:
<script id='hull-js-sdk' data-platform-id='123456a7b89012c3456789d0' data-org-url='https://demo.hullapp.io' src='https://js.hull.io/0.10.0/hull.js.gz' ></script>
That's all for the snippet.
Make sure to check Support document.write before you move on to configure the Triggers.
The answer to what trigger really depends what you have configured in your GTM workspace. For starters you can stick to All Pages:
That's it, preview your page and check in your Hull organization that page views are captured appropriately.