Web Analytics Integration
This page contains integration guides with various Web Analytics solutions, of how to pass martechpass as declared ID.
Why Integrate Utiq martechpass with Analytics?
The Utiq martechpass (mtid) is a semi-stable identifier tied to a real person (or household), persisting across browsers and devices, and rotating every 90 days for privacy and compliance.
When passed as a user ID in Web Analytics, it helps stabilize and unify visitor metrics.
Primary Use Case
Metric Stabilization & Deduplication: More accurately measure Unique Users by reducing identity fragmentation across devices or browsers.
For example, instead of reporting 1.000 ‘visitors’ (duplicate cookies), analytics may reveal 900 true individuals usingmartechpass
, and report a more realistic and stabilized conversion rate.
For more on use cases, visit: Utiq Use Cases
Vendor Integrations
For each integration, Utiq recommends retrieving the mtid
using onIdsAvailable via the addEventListener API, especially when embedding via third-party scripts.
Google Analytics (GA4) via GTM
window.Utiq ||= {};
window.Utiq.queue ||= [];
const handleIdsAvailable = ({ mtid }) => {
// Callback action for onIdsAvailable
if (window.dataLayer && Array.isArray(window.dataLayer)) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'utiqUserIdReady', // Optional: custom event name for triggers
user_id: mtid,
utiq_mtid: mtid // Use this, instead, if you populate user_id already
});
} else {
console.error('Google Tag Manager is not available.');
}
};
window.Utiq.queue.push(() => {
window.Utiq.API.addEventListener('onIdsAvailable', handleIdsAvailable);
});
Configurations to pass martechpass as User ID in GA4
Google Tag Manager configurations
Create a data layer variable
In Google Tag Manager, click Variables
In the User-Defined Variables section, click New
Click Variable Configuration > Data Layer Variable
Enter a name for the variable at the top (e.g. "DLV - user_id")
In the Data Layer Variable Name field, enter a name for your ID (e.g. "user_id")
Click Save
Modify your Google Analytics 4 tag
In Tag Manager, click Tags
Select your Google Analytics 4 tag
Under Configuration settings, add a new row with the following parameters:
Parameter:
user_id
Value: Select the Data Layer variable you created
Click Save
Click Submit to publish the changes
(Optional) Configurations to pass martechpass as Custom Dimension in GA4 instead
In case you populate ‘user_id’ attribute already, and you don’t want to change this to martechpass, you can create a new custom dimension in Google Analytics to capture utiq_mtid
instead.
Google Tag Manager configurations
Create a data layer variable
In Google Tag Manager, click Variables
In the User-Defined Variables section, click New
Click Variable Configuration > Data Layer Variable
Enter a name for the variable at the top (e.g. "DLV - utiq_mtid")
In the Data Layer Variable Name field, enter a name for your ID (e.g. "utiq_mtid")
Click Save
Modify your Google Analytics 4 tag
In Tag Manager, click Tags
Select your Google Analytics 4 tag
Under Configuration settings, add a new row with the following parameters:
Parameter:
user_properties.utiq_mtid
Value: Select the Data Layer variable you created
Click Save
Click Submit to publish the changes
Google Analytics 4 configurations
In Google Analytics 4, in Admin, under Data display, click Custom definitions
Create a custom dimension, with below configurations:
Scope: User
Name:
utiq_mtid
Event parameter:
utiq_mtid
This will then be associated with all events from that user
In case you pass Google Analytics events in BigQuery, the above utiq_mtid
custom dimension can be found under the user_properties
object. This allows joining or modeling of user stability using mtid
as an auxiliary identifier.
Documentation:
Testing: In Console type window.dataLayer
and check for utiqUserIdReady
event. Also filter Network for collect
and check attribute uid
, if you used user_id
, or up.utiq_mtid
, if you used utiq_mtid
, instead.
Marfeel
window.Utiq ||= {};
window.Utiq.queue ||= [];
const handleIdsAvailable = ({ mtid }) => {
// Callback action for onIdsAvailable
if (window.marfeel && window.marfeel.cmd && typeof window.marfeel.cmd.push === 'function') {
window.marfeel.cmd.push(['compass', function(compass) {
compass.setSiteUserId(mtid);
}]);
} else {
console.error('Marfeel is not available.');
}
};
window.Utiq.queue.push(() => {
window.Utiq.API.addEventListener('onIdsAvailable', handleIdsAvailable);
});
Marfeel user reconciliation feature is available only for Enterprise clients.
Documentation:
Testing: Filter Network for ingest
and check attribute sui
Piano Analytics
window.Utiq ||= {};
window.Utiq.queue ||= [];
const handleIdsAvailable = ({ mtid }) => {
// Callback action for onIdsAvailable
if (typeof pa !== 'undefined' && typeof pa.setUser === 'function') {
pa.setUser(mtid);
} else {
console.error('Piano Analytics is not available.');
}
};
window.Utiq.queue.push(() => {
window.Utiq.API.addEventListener('onIdsAvailable', handleIdsAvailable);
});
Documentation:
https://developers.atinternet-solutions.com/piano-analytics/data-collection/how-to-send-events/users
Testing: Filter Network for collect
or pa
and check attribute user.id