Commit fe886732 authored by Savas Vedova's avatar Savas Vedova

Merge branch '328008-load-experiments-via-tracking-options-on-runtime' into 'master'

Load experiments via tracking options on runtime

See merge request gitlab-org/gitlab!67468
parents f0ff168e 7d51d6e0
<script> <script>
import { GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui'; import { GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';
import Vue from 'vue';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
export default { export default {
directives: { directives: {
SafeHtml, SafeHtml,
}, },
mixins: [Tracking.mixin()],
props: { props: {
title: { title: {
type: String, type: String,
...@@ -17,16 +17,6 @@ export default { ...@@ -17,16 +17,6 @@ export default {
required: true, required: true,
}, },
}, },
created() {
const trackingMixin = Tracking.mixin();
const trackingInstance = new Vue({
...trackingMixin,
render() {
return null;
},
});
this.track = trackingInstance.track;
},
}; };
</script> </script>
<template> <template>
......
...@@ -279,7 +279,8 @@ export default { ...@@ -279,7 +279,8 @@ export default {
``` ```
The event data can be provided with a `tracking` object, declared in the `data` function, The event data can be provided with a `tracking` object, declared in the `data` function,
or as a `computed property`. or as a `computed property`. A `tracking` object is convenient when the default
event properties are dynamic or provided at runtime.
```javascript ```javascript
export default { export default {
...@@ -292,6 +293,7 @@ export default { ...@@ -292,6 +293,7 @@ export default {
// category: '', // category: '',
// property: '', // property: '',
// value: '', // value: '',
// experiment: '',
// extra: {}, // extra: {},
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment