Segment and RudderStack
Forward your CDP's calls from Segment or RudderStack, so the user ids it already knows join your people and an alias merges two profiles into one.
Updated
A customer data platform (CDP), such as Segment or RudderStack, already knows who your users are: it sends identify when they sign in and alias when an account changes. Forward its calls to nextanalytica, and those user ids join your people, so your agent reads one person where it would see several.
This works next to the tag, not instead of it: the tag counts visits, and your CDP adds the ids and events only it has.
What do you need?
- A server key. An owner or admin opens Tracking and, under Keys, clicks Make one (or New key) next to Server key. It's shown once, so copy it then. It's the same key your servers use for server events; a new key stops the old one at once, everywhere.
- The address:
https://t.nextanalytica.app/cdp.
Set up Segment
- In Segment, add the Webhooks (Actions) destination to the source you want to forward.
- Add a mapping with the Send action, for the calls you want: Identify, Track, Page, Group and Alias.
- Set URL to
https://t.nextanalytica.app/cdpand Method toPOST. - Under Headers, add
Authorizationwith the valueBearer nask_…, your server key. - Send the whole event as Data, as Segment writes it.
- Turn the destination on.
Batching can stay on: one request takes up to 1,000 calls and 4 MB.
Set up RudderStack
- In RudderStack, add the Webhook destination and connect your source.
- Set the URL to
https://t.nextanalytica.app/cdpand the method toPOST. - Add the header
Authorizationwith the valueBearer nask_…, your server key. - Send the event payload as it is.
What does each call become?
Each call becomes one event of the person it names: userId when it has one, else anonymousId.
| Call | Becomes | What's kept |
|---|---|---|
identify with a userId | The anonymousId is linked to the userId: that person's earlier events become the signed-in person's | Up to 20 traits, as person properties |
identify with an anonymousId only | That person's properties change | Up to 20 traits |
track | A custom event, named as the call's event | Up to 10 properties; revenue or value, with currency, as the event's value |
track named Order Completed | An order | order_id, revenue (or total) and currency |
page | A page view of the person | The path without its query, the host and the title |
group | The person joins a group of type company, keyed by groupId | Up to 20 traits, as the group's properties |
alias | The previousId is merged into the userId: two people become one | Nothing more |
Properties and traits are kept as text: words, numbers and true or false. Nested objects and lists are left out, and each value is cut at 500 characters.
Other calls, such as screen, and calls with no id are skipped; the rest of the request is kept. The answer says how many of each: {"accepted":6,"skipped":1}.
How do the CDP's ids meet the tag's?
Through your user id. Segment's anonymousId isn't the tag's visitor id, so an anonymous visitor seen by both is two people until they sign in. Call identify in the tag with the same user id your CDP sends, and both histories become one person. See Identify people.
alias merges two people even when both had signed in: the userId survives with every id the previousId had.
Do these events count as visits?
No. Like server events, each call is an event of its person that belongs to no visit, so nothing is counted twice when the tag runs too. Orders and conversions from your CDP count under the channel "Server". Visits, pages and channels still come from the tag.
How is consent handled?
Every call your CDP forwards counts as consented: your CDP is where consent is decided, as on your own servers. Set up your CDP's consent settings so calls from people who said no never reach this destination.
Do Not Track and Global Privacy Control aren't checked for these calls, because they come from your CDP, not from a browser.
What is never kept?
- IP addresses.
context.ipis ignored, and the request's own address is your CDP's, never stored. - The rest of
context: the user agent, the location, the device and the library. - Query strings. A page's path loses its query, and emails, tokens, card-like numbers and phone numbers in the path are replaced.
Traits are your data: a trait that is an email address is kept as a person property. Other text, in traits, properties and titles, loses emails, tokens, card-like numbers and phone numbers. Never send passwords.
What time does an event get?
The call's timestamp, else originalTimestamp or sentAt. A time more than a day from now gets the time it arrived instead, so this isn't a way to import old history.
A call your CDP retries, with the same messageId and timestamp, counts once.
What do the answers mean?
| Status | Meaning |
|---|---|
200 | Taken. The body says how many calls were accepted and skipped. |
400 | Not JSON, or no calls, or more than 1,000 in one request. |
401 | The Authorization header is missing, or the server key is unknown. Make a new one in Tracking. |
413 | The request is over 4 MB. Turn the batch size down. |
429 | Too many requests for one project: over 3,000 in 10 seconds. Your CDP retries. |
Next steps
- Identify people: the tag's side of the same person.
- Custom events: events and orders from the page.
- Cookieless counting and consent: what the tag keeps before and after consent.