Allow Additional Internal event properties on Frontend
What does this MR do and why?
In this MR, allowing value
, label
and property
to be passed to snowplow, track_event API and browserSDK for Frontend.
Similar Backend MR - !142839 (merged)
How to set up and validate locally
- Add below code in the last line of tracker/index.js, This will allow us to send track_event API call on any page in GDK.
InternalEvents.trackEvent('user_viewed_dashboard_list', undefined, {
label: 'value',
property: 'value',
value: 2,
});
Here is the patch
diff --git a/app/assets/javascripts/tracking/index.js b/app/assets/javascripts/tracking/index.js
index 2ee4703aa0b..058430338bc 100644
--- a/app/assets/javascripts/tracking/index.js
+++ b/app/assets/javascripts/tracking/index.js
@@ -73,4 +73,9 @@ export function initDefaultTrackers() {
InternalEvents.bindInternalEventDocument();
InternalEvents.trackInternalLoadEvents();
InternalEvents.initBrowserSDK();
+ InternalEvents.trackEvent('user_viewed_dashboard_list', undefined, {
+ label: 'value',
+ property: 'value',
+ value: 2,
+ });
}
- Install snowplow debugger in the browser.
- Refresh any page and verify
value
,label
andproperty
are being passed.
- Verify that it is passed as an object
additional_properties
intrack_event
API call
- If properties are other than
value
,label
andproperty
, it will throw an error.
Related to #434505 (closed)
Edited by Ankit Panchal