Implementing marketing tags with User.com
Integrating User.com with other web services such as Google Analytics or Facebook Ads
This guide provides a focused, step-by-step tutorial on using the "Send code" module to send tracking events to third-party services like Meta (Facebook), Google Ads, or analytics platforms, but only when users meet specific criteria.
Why implement tags via User.com?
While you could add tracking scripts directly to your website's code, the real power of using a marketing automation tool is the ability to fire them conditionally. Standard tracking events are usually tied to simple actions like page views or clicks. With User.com, you can trigger events based on deep CRM data.
For example, you can send a conversion event only for a user who:
Has a deal in a specific CRM stage.
Has not replied to your last three email campaigns.
Has a "Lead Source" attribute of "Organic Search".
This level of precision is difficult to achieve with other tools and allows for highly targeted remarketing and more accurate analytics.
Before you start: prerequisites
Third-party script installed: The base tracking script for your chosen service (e.g., the Meta Pixel, Google's Global Site Tag) must already be installed on your website. This guide is for sending additional, custom events, not the initial setup.
Event snippet ready: You should know the specific JavaScript code required to fire your event (e.g.,
fbq('track', ...)
,gtag('event', ...)
).onPayloadReceived
configured: Your User.com widget implementation must be configured to handle the "Send code" module.
Example: Tracking a high-intent event for Meta Pixel
Scenario: We want to fire a Meta Pixel event when a user who has a deal in the "Qualified Lead" stage visits the pricing page. This is a strong signal of purchase intent.
Step 1: Set up the automation trigger and filters
Add a
Page visit
trigger to your automation canvas.Connect a
Filter
module immediately after the trigger.Configure the filter with the following conditions (using an AND operator):
Deal stage
-> is ->Qualified Lead
Current URL
-> contains ->/pricing
Your automation will now only proceed for users who match both conditions.
Step 2: Add and configure the "Send code" module
Connect the "Action" -> "Send code" module to the "yes" path of your
Filter
module.Ensure you are using the Direct JavaScript Execution method (the "Append to HTML" toggle should be off).
Step 3: Use the multi-tab safe code snippet
A user may have your website open in multiple tabs. The code below solves this by using the browser's localStorage
to ensure the event is only fired once per trigger.
Copy this code and paste it into the "Content" text area:
/*
* Meta Pixel Custom Event Tracker (with Multi-Tab Debounce)
*
* This script prevents the same tracking event from firing multiple times
* if a user has your site open in more than one browser tab.
*/
(function() {
try {
// --- CUSTOMIZE YOUR EVENT HERE ---
// 1. Give your event a descriptive name.
const eventName = 'QualifiedLead_Viewed_Pricing';
// 2. (Optional) Add parameters for more detail.
const eventParameters = {
content_name: 'Pricing Page',
content_category: 'High-Intent Actions',
// You could even pass a deal's value dynamically
// value: '',
// currency: 'USD'
};
// --- DEBOUNCE LOGIC (DO NOT EDIT BELOW) ---
const debounceKey = 'ue_event_fired_' + eventName;
const now = new Date().getTime();
const tenSeconds = 10 * 1000;
const lastFired = localStorage.getItem(debounceKey);
// Only fire if the event hasn't been fired in the last 10 seconds.
if (!lastFired || (now - parseInt(lastFired, 10) > tenSeconds)) {
if (typeof fbq === 'function') {
fbq('trackCustom', eventName, eventParameters);
localStorage.setItem(debounceKey, now.toString());
console.log('Meta Pixel custom event sent:', eventName);
} else {
console.warn('Meta Pixel (fbq) not found. Event not sent.');
}
} else {
console.log('Meta Pixel event skipped (debounce):', eventName);
}
} catch (e) {
console.error("Error firing Meta Pixel event:", e);
}
})();
Step 4: Save and activate
Save the module and activate your automation. You are now tracking a very specific, high-value user interaction that can be used to create powerful custom audiences for your ad campaigns.
Other tracking possibilities
The same principle can be applied to any third-party script that you want to trigger based on User.com data.
Google Ads: Trigger a conversion event for users who came from a specific ad campaign and visited a thank-you page. You would replace the
fbq(...)
call withgtag('event', 'conversion', ...)
Google Analytics: Send a custom event with specific dimensions. For example:
if (typeof ga === 'function' && typeof ga.getAll === 'function') { ga.getAll()[0].send('event', 'CRM Action', 'Form Submitted', 'Qualified Lead Form'); }
LinkedIn Insight Tag: Fire a conversion event when a user with a specific job title (stored in User.com) downloads a whitepaper. The call would be
window.lintrk('track', ...)
Pushing data to Google Tag Manager (GTM): You can push User.com data into GTM's data layer to be used by other tags.
window.dataLayer = window.dataLayer || []; dataLayer.push({ 'event': 'user_com_data', 'user_email': '', 'crm_stage': 'Unknown' });
You would then create Data Layer Variables in GTM to capture these values.
The key is to use User.com's filters to define your target segment and then use the "Send code" module to execute the specific line of JavaScript for your desired platform.
Limitations and next steps
Ad Blockers: This client-side method is simple but can be blocked by ad blockers.
The Next Level: Server-to-Server: For maximum reliability, especially for critical conversion events, we recommend exploring server-to-server integrations (like Meta's Conversions API). These methods are not affected by ad blockers because they communicate directly from User.com's servers to the third-party platform.