User ID Tracking
FirstHive CDP includes a User ID feature for enhanced tracking on websites and applications that allow visitors to log in. This feature enables businesses to connect a unique identifier—such as a visitor’s username, email, or customer ID—with their analytics data for more accurate tracking.
By tracking the User ID, you can connect visits from the same user across multiple sessions, dates, and devices, ensuring a more unified and precise view of customer behavior.
Benefits of Enabling User ID Tracking
Enabling User ID tracking in FirstHive CDP provides several advantages:
- More accurate unique visitor counts
- FirstHive CDP typically uses multiple heuristics to determine whether a visit is unique. With User ID tracking, you can reliably track the same user across different devices, browsers, and locations, resulting in more precise visitor counts.
- Understand where users are getting stuck
- Segment visits by a specific User ID to see where an individual user may be facing issues. This makes it easier to offer targeted customer support when people encounter challenges navigating your site or app.
- Learn what specific users are doing
- View the Visits Log for individual users based on their User ID. This shows all actions performed across all visits—ideal for providing customer support, troubleshooting, or conducting security audits.
- View full User Profiles
- Build detailed profiles for each user, including time spent on your site, access locations, and lifetime Ecommerce or engagement value. This is especially useful for market research and personalization strategies.
- Identify your most engaged users
- Generate lists of highly engaged users and sort them by metrics like session duration, frequency, or spend. This helps you identify loyal customers, analyze behaviors, and optimize engagement strategies.
To enable User ID functionality in FirstHive CDP, you need to start sending User IDs to the platform. First, identify what data your site holds for each user that can be used as a unique identifier. Every system that allows users to log in will have at least one unique value—such as a user ID number, username, or email address.
It is recommended to set a user’s email address as the User ID when possible. This ensures you can also track the same user when they complete a contact or subscription form, even if they are logged out.
The next step is to send this unique identifier to FirstHive CDP. The exact method depends on your website setup. Below are the different methods available.
Configuring User ID Tracking for WordPress
If you are using WordPress, there are two main ways to integrate with FirstHive CDP:
- FirstHive CDP for WordPress Plugin – where the CDP is embedded directly in your WordPress environment.
- FirstHive Connector Plugins (WP-FirstHive) – for FirstHive CDP Cloud or On-Premise deployments.
Note: WordPress users can typically change their email address, but not their username. If you want the most reliable long-term identifier, select Username. If you also want to track form submissions for logged-out users, use Email Address instead.
FirstHive CDP for WordPress: Enable User ID Tracking
- Log in to your WordPress dashboard with admin access.
- Hover over FirstHive CDP Analytics in the menu → click Settings.
- Scroll to the User ID dropdown → select Email Address or Username.
- Click Save Changes. User ID tracking will now be enabled.
FirstHive Connector Plugin (WP-FirstHive): Enable User ID Tracking
- Log in to your WordPress dashboard.
- Navigate to Settings → Connect FirstHive CDP.
- Open the Enable Tracking tab.
- Enable a non-manual tracking method under Add tracking code.
- Scroll to User ID Tracking → select Email Address or Username.
- Click Save Changes. User IDs will begin tracking immediately.
Configuring User ID Tracking with FirstHive Tag Manager
If your site uses FirstHive Tag Manager, setup will vary based on your build. Since there’s no universal way of embedding User IDs into your code, you may need developer assistance.
Steps:
- Install and configure FirstHive Tag Manager on your site.
- Create a variable (e.g., UserID) that captures the visitor’s unique identifier.
- If usernames are visible on the front-end, you can use a DOM selector.
- Or configure your site to expose an identifier (e.g., email) in the data layer with custom code.
- A practical option: store the email in a first-party cookie or local storage, then create a Custom JavaScript Variable in Tag Manager to retrieve it.
- Update your FirstHive Configuration variable to collect the UserID.
- In the User ID field, enter {{UserID}}.
- Preview and test in Tag Manager’s debug mode to ensure the UserID variable is detected.
- Publish the container to begin tracking User IDs.
Sending User ID via JavaScript Tracking
For custom-built websites, you can use the FirstHive CDP JavaScript Tracking API to send User IDs.
Example snippet:
<script type=“text/javascript”> var fhq = window.fhq = window.fhq || []; fhq.push([‘setUserId’, ‘USER_ID_HERE’]); fhq.push([‘trackPageView’]); fhq.push([‘enableLinkTracking’]); (function() { var u=”//{$FIRSTHIVE_URL}/”; fhq.push([‘setTrackerUrl’, u+‘firsthive.php’]); fhq.push([‘setSiteId’, {$SITEID}]); var d=document, g=d.createElement(‘script’), s=d.getElementsByTagName(‘script’)[0]; g.type=‘text/javascript’; g.async=true; g.src=u+‘firsthive.js’; s.parentNode.insertBefore(g,s); })(); </script>
- setUserId defines the data being sent.
- Replace USER_ID_HERE with your website’s dynamic User ID value.
- Insert this code above the tracking action (e.g., before trackPageView).
Sending User ID with FirstHive SDKs
If you are using one of the FirstHive SDKs (e.g., iOS, Android, or other apps), simply call:
setUserId(USER_ID);
Or, you can pass the User ID via the FirstHive HTTP Tracking API.
© 2026 FirstHive. All rights reserved.