Segment already routes your event data everywhere, so attaching a device signal to those events lets your downstream tools see which users are real and which are automated. Adding Prynt gives every Segment event a verifiable visitor ID and bot score.
This guide captures a Prynt ID in the browser, attaches it to your Segment calls, and verifies events server-side before anything acts on them. Because Segment already fans your events out to every tool, adding the device signal once means it reaches your warehouse, your CRM, and your fraud rules without a separate integration for each.
Load the agent alongside analytics.js
Initialize the agent once when the page loads, next to your Segment snippet.
Packages: Prynt’s npm package is coming. Until then, use the script tag and the plain REST calls below; they work today.
// lib/prynt.js: loads Prynt's browser agent from the CDN once and reuses it.
let agent;
export function getPrynt() {
agent ??= new Promise((resolve, reject) => {
const s = document.createElement('script');
s.src = 'https://api.pryntid.com/cdn/prynt.umd.js';
s.async = true;
s.onload = () => resolve(window.Prynt.load({
apiKey: import.meta.env.VITE_PRYNT_KEY, // your public key
endpoint: 'https://api.pryntid.com',
}));
s.onerror = () => { agent = undefined; reject(new Error('Prynt agent failed to load')); };
document.head.appendChild(s);
});
return agent;
}
getPrynt().catch(() => {}); // warm it up on page load
Keep a single agent per page. It loads asynchronously and never blocks your analytics.
Attach the visitor ID to Segment calls
Call identify() at a decision point and pass the requestId as a trait or property so it rides through your pipeline.
const agent = await getPrynt()
const result = await agent.identify({ tag: { action: 'signup' } })
analytics.identify(userId, {
pryntId: result.requestId
})
analytics.track('Signup Submitted', {
pryntId: result.requestId
})
Now every destination sees the event ID. It is not trustworthy yet, but it is available where you need it.
Verify in a destination function or backend
A Segment destination function or your own backend verifies the event with the secret key. This is where the decision happens.
// destination function or server handler
// secretKey: settings.pryntSecretKey (a sensitive setting) in a destination function,
// process.env.PRYNT_SECRET_KEY in your own backend
const res = await fetch(
`https://api.pryntid.com/v1/events/${encodeURIComponent(event.properties.pryntId)}`,
{ headers: { Authorization: `Bearer ${secretKey}` } }
)
if (!res.ok) throw new Error(`Prynt lookup failed: ${res.status}`) // 404 = unknown or forged ID
const data = await res.json()
if (data.smartSignals?.bot?.result) {
suppressEvent() // do not forward to conversion tools
}
Verifying server-side also keeps bot traffic out of your analytics, so conversion numbers reflect real humans. The available fields, including proxy and ASN data, are in the bot detection guide.
Be deliberate about where you verify. A Segment destination function runs on Segment’s infrastructure and can hold your secret key securely, which is convenient for suppression logic. If you would rather keep the key in your own environment, verify in the backend that receives your server-side track calls instead. Either way, the browser only ever transports the event ID as a trait, and the decision that touches your funnel or your fraud queue lives somewhere a bot cannot reach.
Guard forms directly
For signup or lead forms, let Form Shield watch the element and add behavioral signals for scripted fills.
const agent = await getPrynt()
agent.protectForm(document.querySelector('#lead'), {
autoGuard: true,
expectedScripts: ['latin']
})
expectedScripts flags submissions in unexpected writing systems, a low-cost spam signal for Latin-script audiences. It adds a behavioral layer on top of the identity check your server performs.
Use the signal to clean your data and your funnel
With verified device signals flowing through Segment, you can do two things at once: block fraud at the point of action and stop counting bots as conversions. Route low-confidence events to review instead of your paid-ads pixels, and store the visitor ID against the user for later fraud rules.
Because Prynt is a managed cloud service, geolocation, VPN detection, and bot scoring arrive with no infrastructure to run, and the free tier covers early traffic while you validate the pipeline. This dual payoff, cleaner analytics and better fraud coverage from one integration, is what makes the Segment path worth the small amount of wiring. Add a key, attach the ID to your Segment calls, and verify server-side. See the pricing and free plan to start enriching your event data with trustworthy device signals.
Try it free
Prynt is device intelligence with a free plan: 5,000 identifications a month, visitor IDs with confidence and bot detection — no credit card. Upgrade to Pro for VPN, proxy, tampering and behavioral signals.