Skip to content
代码片段 群组 项目
提交 0c76f4ff 编辑于 作者: Lorena Ciutacu's avatar Lorena Ciutacu
浏览文件

Merge branch 'update-documentation-internal-events' into 'master'

Update docs: Clarify extra & context in trackEvent method

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/135679



Merged-by: default avatarLorena Ciutacu <lciutacu@gitlab.com>
Approved-by: default avatarLorena Ciutacu <lciutacu@gitlab.com>
Reviewed-by: default avatarAnkit Panchal <apanchal@gitlab.com>
Reviewed-by: default avatarLorena Ciutacu <lciutacu@gitlab.com>
Co-authored-by: default avatarAnkit <apanchal@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -148,3 +148,27 @@ Sometimes we want to send internal events when the component is rendered or load
= render Pajamas::ButtonComponent.new(button_options: { data: { event_tracking_load: 'true', event_tracking: 'i_devops' } }) do
= _("New project")
```
### Props
Apart from `eventName`, the `trackEvent` method also supports `extra` and `context` props.
`extra`: Use this property to append supplementary information to GitLab standard context.
`context`: Use this property to attach an additional context, if needed.
The following example shows how to use the `extra` and `context` props with the `trackEvent` method:
```javascript
this.trackEvent('i_code_review_user_apply_suggestion', {
extra: {
projectId : 123,
},
context: {
schema: 'iglu:com.gitlab/design_management_context/jsonschema/1-0-0',
data: {
'design-version-number': '1.0.0',
'design-is-current-version': '1.0.1',
},
},
});
```
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册