Skip to content

Commit 8606c5b

Browse files
authored
Use account-level SQL traits to associate users to the account
1 parent 31146f6 commit 8606c5b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/engage/audiences/account-audiences.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ Use-cases for account-level computed traits include:
6666
> info ""
6767
> Use SQL traits for complex calculations not supported by computed traits. For example, you would use SQL traits to calculate the number of unique users associated with an account who have logged in during the past month.
6868
69+
### Use account-level SQL traits to associate users to the account
70+
71+
To associate users to an account via SQL traits, we have to return both group_id and user_id in the account level SQL trait - this will fire a group call with the userId and the groupId in question, which is the method that Segment uses to add users to groups in destinations.
72+
73+
There is a limitation on Segment end when a group (account) contains more than one user, the query will return duplicate group_ids (mapped to unique user_ids). Segment won't allow us to return duplicate group_id's in the Group(account level) SQL trait., So we can't map the users to the accounts on many-to-many situation.
74+
6975
### Use account-level computed and SQL traits as account-level audience conditions
7076

7177
Once created, you can connect account-level computed and SQL traits to downstream destinations. You can also use them as conditions in account-level audiences, enabling you to build audiences based on the set of events triggered by all users associated with a given account.

0 commit comments

Comments
 (0)