
How to set up
1. Import the Fingerprint Segment Source Function
- Log in to your Segment account.
- Navigate to Connections > Catalog and switch to the Functions tab.
- Click New Function.
- Select Source, then click Build.
- Replace the source code with the latest Fingerprint Segment source function.
- Click Configure, and enter a descriptive name, such as
Fingerprint Source Function. - Optionally, you can add a description and logo of your choice.
- Click Create Function.
2. Create a Segment Source connected to the Fingerprint Source function
Continuing from the previous step (or if you have closed the browser tab, go to Connections > Catalog > Functions > Fingerprint Source Function)- Click Connect Source.
- Add a descriptive name, for example
Fingerprint visitor identification events. Optionally, you can put labels of your choice. - Click Continue, then Continue again, a finally Finish.
3. Configure a Fingerprint webhook to send data to Segment
- Log in to your Fingerprint account.
- Go to Webhooks.
- Click Add Webhook.
- Paste the webhook URL of your Source. (You can always find it in Segment > Connections > Sources > Your Fingerprint Source > Overview )
- Optionally, add a description, for example “Segment source”. Do not set any authentication.
- Click Save.
- Click Send Test Event and wait for a confirmation that Segment successfully received the test event data. If you do not see the confirmation, check the webhook URL and try again. Sending the test event can take a minute or two.
4. Configure the Fingerprint JavaScript Agent on your website
The Segment integration is not enabled by default. Your website must have the Fingerprint JS Agent installed and configured explicitly to use the Segment Integration.- If you haven’t already, install the Fingerprint JS Agent on your website, for example:
- Insert a
tag.integrations.segmentobject into the options of the JS agent’sgetmethod to enable your Segment integration. The Segment Source function will ignore identification events received from Fingerprint that do not include thetag.integrations.segmentobject. For more info abouttagsee the JS agent API Reference.
- Inside the
segmentobject, define Segment Specs, like below:
identify, page, group, and track for corresponding Specs. You can use any or all specs in a single request, the Identify Spec is sent even when omitted. You can use skipIntegration for skipping the segment integration entirely.
See How to use for more details on each spec.
Receiving and using the data
Now that the JS Agent and Segment Source are connected, the Specs should be flowing to your segment account as visitors come your website and are identified by Fingerprint. You can debug the data coming in by going to Connections > Sources > Your Fingerprint Source > Debugger.Set up some destinations to use the data, for example, Google Analytics, Castle, Mixpanel, or others that suit your business needs the best.
How to use
The Fingerprint Segment Source function creates Specs based on the the visitor identification result and the metadata you pass to thetag.integration.segment object.
Full Example
Full Example
Identify Spec
The Identify Spec lets you record who the visitor is and the traits you know about them. You can use thesegment.identify field to pass your visitor metadata to Segment. This spec is always created based on the visitor identification result, even when you omit the identify field.
| Identify Spec field | Source field in Fingerprint result or metadata passed to segment.identify |
|---|---|
anonymousId | result.visitorId - Fingerprint visitorId |
traits.visitorId | result.visitorId - Fingerprint visitorId |
traits.createdAt | result.firstSeenAt.subscription - time of the first visit recorded in your workspace |
userId | identify.userId - your internal user ID |
traits | identify.traits - any traits you want to record |
Page Spec
The Page Spec lets you record whenever a user sees a page of your website, along with any optional properties about the page. It is defined by thepage field.
| Page Spec field | Source field in Fingerprint result or metadata passed to segment |
|---|---|
anonymousId | result.visitorId - Fingerprint visitorId |
userId | identify.userId - your internal user ID |
context.ip | result.ip - IP address |
context.browserDetails | result.browserDetails - Browser, OS name and version |
context.incognito | result.incognito - Incognito mode |
context.confidenceScore | result.confidenceScore - Confidence score |
context.requestId | result.requestId - ID of Fingerprint request |
properties.url | result.url - page URL |
context | page.context - any context you want to record |
properties | page.properties - any properties you want to record |
Track Spec
The Track Spec is how you record the actions your users perform, along with any properties that describe the action. It is defined by thetrack field.
| Track Spec field | Source field in Fingerprint result or metadata passed to segment.track |
|---|---|
event | track.event - the event you’re tracking, required |
properties | track.properties - any properties you want to record |
anonymousId | result.visitorId - Fingerprint visitorId |
userId | identify.userId - your internal user ID |
⚠️ The event field is required to create a Track Spec.
Group Spec
The Group Spec is how you associate an individual user with a group, for example, a company, organization, account, project, or team. It is defined by thegroup field.
| Group Spec field | Source field in Fingerprint result or metadata passed to segment |
|---|---|
groupId | group.groupId - the group ID you’re tracking, required |
traits | group.traits - any grouptraits you want to record |
anonymousId | result.visitorId - Fingerprint visitorId |
userId | identify.userId - your internal user ID |
⚠️ The groupId field is required to create a Group Spec.
Screen Spec
Screen Spec is currently not supported.Skipping the integration
SetskipIntegration to true to prevent the source function from creating any Specs. Defaults to false.