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

Update docs: Clarify extra & context in trackEvent method

上级 92e2d71d
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 ...@@ -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 = render Pajamas::ButtonComponent.new(button_options: { data: { event_tracking_load: 'true', event_tracking: 'i_devops' } }) do
= _("New project") = _("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.
先完成此消息的编辑!
想要评论请 注册