Tags cannot be used to collect email or IP addresses, or numbers with 9 or more digits
Since there is currently no way to use our Visitor Lookup tool with tags, they cannot be used to collect emails or IP addresses. We also suppress numbers with 9 or more digits, to prevent credit card numbers being passed to Hotjar. This decision has been based on the General Data Protection Regulation (GDPR). If you'd like to collect email addresses with your user's consent and in line with GDPR, you can do so with User Attributes.
Tagging your Recordings allows you to note specific actions, like CTA clicks, sign-ups, or visitor states. Once Recordings have been tagged, you can then filter by tag in your Recordings dashboard.
You can tag Recordings in two ways:
- Tagging Manually: within the Hotjar Recordings player.
- Tagging Automatically: by installing a JavaScript snippet on your site. This is only available to accounts on the Hotjar Plus plan or above.
1000 Tag limit per Hotjar site
There can only be 1,000 unique tags per Hotjar site. If you exceed this, only 1,000 of the most used tags (sorted 0-9, a-Z) will be searchable in the interface. This is a rolling total so once the limit is exceeded, tags may become unsearchable. Using tags to track products, users, or errors should only be used if the combined number of needed tags is less than 1000.
How to Tag Recordings Manually
Open a Recording.
Select the Session Info panel from the top right.
Use the field provided to add new tags or delete existing ones by hitting the X next to them.
Editing and Deleting tags must be done manually within the Recording player
There is currently no automatic way to edit/remove tags. The tag will have to be edited/removed in every Recording it is tagged in order for the tag itself to be edited/removed.
How to Tag Recordings Automatically
Tagging with JavaScript is a feature for our paid plans
This is only available for Plus and Business accounts.
To tag a Recording, add this JavaScript code:
hj('tagRecording', ['tag1', 'tag2']);
Doing so will cause all Recordings of visitors who pass-through this page to include the two tags "tag1" and "tag2".
If there is a chance that the code will be run before the Hotjar script has loaded, you must add this line of code just before:
window.hj=window.hj||function(){(hj.q=hj.q||[]).push(arguments)};
If you add the same tag on multiple pages, Hotjar will automatically detect the duplicates and only save one tag.
The tags can be any alphanumeric value you like including spaces, e.g. 'Checkout Page'. The Recording will fail to tag if it has more than 250 characters.
A single Recording can have no more than 50 tags. Any additional tags will be ignored.
You can also set up JavaScript Triggers through Google Tag Manager.
If you use Google Tag Manager to load the Hotjar script on your site, you can set up JavaScript Triggers on the GTM tag that fires the Hotjar tracking code. Check out this guide on how to set up JavaScript Triggers in GTM.
Examples of Automatic Tagging
Example 1: Tagging users who logged into your app
To identify users who logged in, add the following tag to your admin pages.
hj('tagRecording', ['Logged In User']);
Example 2: Tagging users who tried to sign-up
To track users who tried to sign-up to your service, add the code to the JavaScript function which processes your sign-up form.
function register() {
hj('tagRecording', ['Attempted Sign-up']);
...
}
Example 3: Tagging users who added a product to their cart and tagging the product they added
You may tag users who added a product to their cart and also tag the product they added by adding the JavaScript snippet to the function which processes items in your cart.
function addToCart(product) {
hj('tagRecording', ['Added Product To Cart', product]);
...
}
addToCart('Product XYZ');
In the example above, we pass the "product" variable as the second parameter. This will result in your Recording being tagged with both "Added Product To Cart" as well as "Product XYZ"
Example 4: Tagging a user who signed up for your newsletter and opened your gallery
To track more than one event, you can use the JavaScript snippet multiple times.
function newsletterSignup() {
hj('tagRecording', ['Signed-up to Newsletter']);
}
function openGallery() {
hj('tagRecording', ['Browsed Gallery']);
}
The Recording will be saved with both tags: "Signed-up to Newsletter" and "Browsed Gallery".
Do not use tags to identify users, or pass personally-identifying information.
You can connect User IDs to Hotjar User IDs by using our Identify API. Use cases for this API can be found in the Identify API Reference.