diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-22 15:07:55 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-22 15:07:55 +0300 |
commit | fb336d5f6b8b2c8f3131ee97a68ebc80c64a0223 (patch) | |
tree | 902d2767f2c9ca4dd5a971eccd68a69e75a6ef78 /doc/development/service_ping/implement.md | |
parent | 2b0b59094ad207c5e608537d398c822970930b19 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development/service_ping/implement.md')
-rw-r--r-- | doc/development/service_ping/implement.md | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/doc/development/service_ping/implement.md b/doc/development/service_ping/implement.md index 1f2f0cfd40e..af3a73144b2 100644 --- a/doc/development/service_ping/implement.md +++ b/doc/development/service_ping/implement.md @@ -360,10 +360,10 @@ Implemented using Redis methods [PFADD](https://redis.io/commands/pfadd/) and [P 1. Use one of the following methods to track the event: - - In the controller using the `RedisTracking` module and the following format: + - In the controller using the `ProductAnalyticsTracking` module and the following format: ```ruby - track_event(*controller_actions, name:, conditions: nil, destinations: [:redis_hll], &block) + track_custom_event(*controller_actions, name:, action:, label:, conditions: nil, destinations: [:redis_hll], &block) ``` Arguments: @@ -371,6 +371,8 @@ Implemented using Redis methods [PFADD](https://redis.io/commands/pfadd/) and [P - `controller_actions`: the controller actions to track. - `name`: the event name. - `conditions`: optional custom conditions. Uses the same format as Rails callbacks. + - `action`: optional action name for the triggered event. See [event schema](../snowplow/index.md#event-schema) for more details. + - `label`: optional label for the triggered event. See [event schema](../snowplow/index.md#event-schema) for more details. - `destinations`: optional list of destinations. Currently supports `:redis_hll` and `:snowplow`. Default: `:redis_hll`. - `&block`: optional block that computes and returns the `custom_id` that we want to track. This overrides the `visitor_id`. @@ -379,10 +381,14 @@ Implemented using Redis methods [PFADD](https://redis.io/commands/pfadd/) and [P ```ruby # controller class ProjectsController < Projects::ApplicationController - include RedisTracking + include ProductAnalyticsTracking skip_before_action :authenticate_user!, only: :show - track_event :index, :show, name: 'users_visiting_projects' + track_custom_event :index, :show, + name: 'users_visiting_projects', + action: 'user_perform_visit', + label: 'redis_hll_counters.users_visiting_project_monthly', + destinations: %i[redis_hll snowplow] def index render html: 'index' |