-
Notifications
You must be signed in to change notification settings - Fork 81
Added doc for Anonymous user segmentation in CDP #3199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 5.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| --- | ||
| description: Adding tracking in [[= product_name_cdp =]]. | ||
|
Check failure on line 2 in docs/cdp/cdp_activation/cdp_add_tracking.md
|
||
| edition: experience | ||
| --- | ||
|
|
||
| # Add tracking | ||
|
|
||
| The final step is setting up a tracking script that identifies visitors and records their interactions. | ||
| You can set it up in two ways: | ||
|
|
||
| ## Tracking with built-in Raptor tracking functions | ||
|
|
||
| If your project uses the [Raptor connector](raptor_connector.md), use the built-in [Raptor tracking functions](tracking_functions.md). | ||
| This recommended approach supports both client-side and server-side tracking, handles cookie consent, and sets the tracking cookie required for [anonymous user segmentation](cdp_configuration.md#anonymous-user-segmentation). | ||
|
|
||
| For setup instructions, see [Raptor tracking functions](tracking_functions.md). | ||
|
|
||
| ## Manual setup | ||
|
|
||
| If you aren't using the Raptor connector, you can set up tracking manually. | ||
|
Check notice on line 20 in docs/cdp/cdp_activation/cdp_add_tracking.md
|
||
|
|
||
| It requires a head tracking script between the `<head></head>` tags on your website, a main script after the head script, and cookie consent. | ||
|
|
||
| For more information about setting up a tracking script manually, see [Raptor documentation](https://content.raptorservices.com/help-center/client-side-tracking). | ||
|
|
||
| Now, you need to add a tracker to specific places in your website where you want to track users. | ||
| For example, add this tracker to the landing page template to track user entrances. | ||
|
|
||
| ```js | ||
| raptor.trackEvent('visit', ..., ...); | ||
| ``` | ||
| or purchases: | ||
|
|
||
| ```js | ||
| //Parameters for Product 1 | ||
| raptor.trackEvent('buy', ..., ...); | ||
| //Parameters for Product 2 | ||
| raptor.trackEvent('buy', ..., ...); | ||
| ``` | ||
|
|
||
| For tracking to be effective, you also need to send ID of a logged-in user in the same way. | ||
| Add the user ID information of logged-in users by using below script: | ||
|
|
||
| ```js | ||
| raptor.push("setRuid","USER_ID_HERE") | ||
| ``` | ||
|
|
||
| For anonymous visitors, Raptor's tracking script automatically sets an `rsa` cookie that uniquely identifies the visitor, without calling the `setRuid` method. | ||
|
Check failure on line 48 in docs/cdp/cdp_activation/cdp_add_tracking.md
|
||
|
|
||
| For more information on tracking events, see [the documentation](https://content.raptorservices.com/help-center/tracking-events-for-recommendation). | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apparently this link doesn't work. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,13 +31,21 @@ | |
| client_id: '%env(CDP_ACTIVATION_CLIENT_ID)%' | ||
| client_secret: '%env(CDP_ACTIVATION_CLIENT_SECRET)%' | ||
| segment_group_identifier: example_segment_group_identifier | ||
| membership: # For anonymous user segmentation | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’ve just added a PR with the commented default configuration to recipes: Maybe we should align the environment variable naming to keep it consistent. |
||
| activation_id: '%env(CDP_API_ACTIVATION_ID)%' | ||
| api_key: '%env(CDP_API_KEY)%' | ||
| base_url: 'https://cdp-api.raptorsmartadvisor.com' | ||
| timeout: 5 | ||
| ``` | ||
|
|
||
| - `account_number` - a [number](#account-number) obtained from Accounts settings in [[= product_name_cdp =]] dashboard | ||
| - `stream_id` - stream ID generated when importing data from the stream file in Data Manage | ||
| - `activations` - activation details. You can configure multiple activations. They have to be of type `Ibexa` in [[= product_name =]] dashboard | ||
| - `client_id` and `client_secret` - client credentials are used to authenticate against the Webhook endpoint. Make sure they're random and secure | ||
| - `segment_group_identifier` - a [location](#segment-group) to which CDP data is imported | ||
| - `membership.activation_id` and `membership.api_key` - credentials for the CDP Membership API, required for [anonymous user segmentation](#anonymous-user-segmentation) | ||
| - `membership.base_url` - base URL of the CDP Membership API (default: `https://cdp-api.raptorsmartadvisor.com`) | ||
| - `membership.timeout` - timeout in seconds for Membership API requests (default: `5`) | ||
|
|
||
| ## Account number | ||
|
|
||
|
|
@@ -65,3 +73,38 @@ | |
|  | ||
|
|
||
| Next, add a segment group identifier to the configuration. | ||
|
|
||
| ## Anonymous user segmentation | ||
|
|
||
| To set up [segmentation for Anonymous visitors](cdp_guide.md#anonymous-user-segmentation), execute the following steps: | ||
|
|
||
| ### Set up CDP API activation | ||
|
Check notice on line 81 in docs/cdp/cdp_activation/cdp_configuration.md
|
||
|
|
||
| Create an activation of type "CDP API" in the Raptor dashboard. | ||
| For instructions, see [CDP API activations](https://content.raptorservices.com/help-center/cdp/activations/cdp-api) in Raptor documentation. | ||
|
|
||
| ### Configure website tracking dataflow | ||
|
|
||
| Set up a "Website tracking" dataflow with `coid` (cookie ID) as the person identifier so that Raptor can use the tracking data in the CDP. | ||
|
|
||
| For more information, see [Website tracking dataflow](https://content.raptorservices.com/help-center/tools/datamanager/introduction-to-the-data-manager#:~:text=Website%20tracking,-You) in Raptor documentation. | ||
|
|
||
| ### Configuration | ||
|
|
||
| First, add the `membership.activation_id` and `membership.api_key` credentials to your [`ibexa_cdp` configuration](#configuration), using the values for [CDP API activation](#set-up-cdp-api-activation). | ||
|
Check failure on line 94 in docs/cdp/cdp_activation/cdp_configuration.md
|
||
|
|
||
| To control how long resolved segment memberships are cached per visitor, use the `ibexa_segmentation.anonymous.cache` configuration key: | ||
|
Check notice on line 96 in docs/cdp/cdp_activation/cdp_configuration.md
|
||
|
|
||
| ```yaml | ||
| # config/packages/ibexa_segmentation.yaml | ||
| ibexa_segmentation: | ||
| anonymous: | ||
| cache: | ||
| enabled: true # default; set to false to disable | ||
| ttl: 300 # cache lifetime in seconds, default 300 (5 minutes) | ||
| pool: 'ibexa.cache_pool' # Symfony cache pool service ID, default ibexa.cache_pool | ||
| ``` | ||
|
|
||
| - `enabled` - whether to cache CDP segment results per visitor cookie. Disabling this causes an additional API call to Raptor on every request | ||
| - `ttl` - how long resolved segment results are cached per visitor (in seconds) | ||
|
Check notice on line 109 in docs/cdp/cdp_activation/cdp_configuration.md
|
||
| - `pool` - the Symfony cache pool used to store the results | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is existing content (git didn't handle the rename correctly), except for the anonymous user mention around line 48.