Skip to main content

Identifying groups

Overview

Identifying groups is similar to identifying users, the only difference is that at it identifies groups inside of your product instead of individual users.

Group identification

Developers identify groups to Dopt using the Dopt groups API. We manage your group data via upsertion i.e. we provide a single set of APIs for both creating new groups in Dopt and updating existing groups.

If you’ve used a Customer Data Platform (CDP) like Segment before, this will be familiar to you.

API reference →

curl \
-H "Content-Type: application/json" \
-H "x-api-key:$USERS_API_KEY" \
-d '{
"identifier": "123456789",
"properties": {
"name": "Acme co.",
"plan": "Pro"
}
}' \
-X POST \
https://users.dopt.com/identify/group

We recommend you use a unique group identifier that won’t change, such as a database ID from your organization’s internal systems.

info

When you use the groups API in the browser the source’s write key is public because it runs in a user’s browser and can be accessed using the browser’s developer tools. You can also call identify via the server which collects data from a server-based installation and isn’t accessible to the user.

Updating group properties

You can update group properties by using the groups API. Call the groups API with a group identifier and new or updated group properties. The group properties will be updated via upsertion: if the group property doesn’t exist, it will be created. If it does exist, it will be updated.

Configure group in the Dopt provider

You set the group in the <DoptProvider /> like this:

  <DoptProvider
flowVersions={{ "$YOUR_FLOW_ID": $FLOW_VERSION }}
userId={$USER_ID}
groupId={$GROUP_ID}
apiKey={$BLOCKS_API_KEY}
>