Setting the UVID (First-Party User ID)
Overview
The UVID is CHEQ's user/visitor identifier for a session. By default CHEQ tracks sessions on its own, but you can pass in your own first-party ID, the same identifier you already use in your analytics platform, CDP, or data warehouse, and associate it with the CHEQ session.
Setting the UVID is what lets you join CHEQ's detection data to your data. Once a session carries your first-party ID, you can:
- Export CHEQ data with a User ID as the primary key rather than just a timestamp, so each record lines up with a known user.
- Match CHEQ verdicts against the user records in your analytics tool or CDP, like a high-fidelity lookup table.
- Stitch a user's activity together across the session and tie identity to traffic intelligence.
This is the recommended foundation for CHEQ's deeper, ID-based integration methods.
The code
Set the UVID by pushing it onto the CHEQ event queue:
window._cq && _cq.events && _cq.events.push({ uvid: "[YOUR FIRST-PARTY ID]" });Replace [YOUR FIRST-PARTY ID] with the identifier you want to associate with the session.
When a UVID is set this way, CHEQ transmits it as an update uvid action against the current session.
How this snippet behaves
This snippet guards rather than initializes. It reads as: only if window._cq exists, and _cq.events exists, then push the UVID.
That is a deliberate difference from the event-tracking snippet, which creates the queue if it isn't there yet:
// Event tracking: initializes the queue if needed
window._cq = window._cq || (_cq = { events: [] });
_cq.events.push({ event: "EVENT_NAME" });
// UVID: only fires once the CHEQ library has loaded
window._cq && _cq.events && _cq.events.push({ uvid: "[YOUR FIRST-PARTY ID]" });The practical implication: a UVID should attach to a live CHEQ session. If the CHEQ library hasn't loaded yet, the guard simply does nothing instead of creating an empty, orphaned queue. Because of this, timing matters, fire the snippet once both conditions are true:
- The CHEQ library has loaded, and
- Your first-party ID is actually available on the page.
Setting the UVID alongside an event
You don't have to set the UVID on its own push. You can attach it to a meaningful event in a single call:
_cq.events.push({ event: "submit_form", uvid: "[YOUR FIRST-PARTY ID]" });This records the event and associates the user ID with the session at the same time, which is handy when the ID becomes known at the exact moment of a key action (for example, a logged-in form submission).
Deploying via Google Tag Manager
- Create a new Custom HTML tag.
- Paste the snippet inside
<script>tags, mapping your first-party ID to a GTM variable:
<script>
window._cq && _cq.events && _cq.events.push({ uvid: {{First-Party User ID}} });
</script>- Attach the tag to a trigger that fires once the ID is available, such as a login event, a data layer push that contains the user ID, or a page where the ID is reliably present.
Deploying via Adobe Launch
- Use an existing rule, or create a new rule, that fires when your first-party ID is available.
- Add a Custom Code (JavaScript) action.
- Paste the snippet, pulling the ID from a Data Element:
window._cq && _cq.events && _cq.events.push({ uvid: _satellite.getVar("First-Party User ID") });- Save the rule, test in a Development library, then publish.
The same approach applies to CHEQ Manage / Ensighten or any other Tag Management System: resolve your first-party ID, then fire the guarded snippet.
Choosing a good ID
- Use a stable, first-party identifier. The value of the UVID comes from it matching the same user in your other systems, so use the ID you already key on (for example, your CRM ID, account ID, or logged-in user ID).
- Be consistent. Send the same ID format across pages and surfaces so sessions stitch together correctly and exports line up cleanly with your records.
- Avoid sensitive data. Use an opaque identifier, not an email address, raw PII, or anything you wouldn't want flowing through your tag manager.
Considerations
- Set it as early as the ID is known. The sooner the UVID is attached, the more of the session is associated with that user.
- It updates the session. Setting a UVID transmits as
update uvidagainst the active session rather than starting a new one. - No queue is created if the library isn't ready. Because the snippet guards on
window._cqand_cq.events, firing it before the CHEQ library loads is a no-op. Trigger it after load.