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>
import { GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';
import Vue from 'vue';
import Tracking from '~/tracking';
export default {
directives: {
SafeHtml,
},
mixins: [Tracking.mixin()],
props: {
title: {
type: String,
......@@ -17,16 +17,6 @@ export default {
required: true,
},
},
created() {
const trackingMixin = Tracking.mixin();
const trackingInstance = new Vue({
...trackingMixin,
render() {
return null;
},
});
this.track = trackingInstance.track;
},
};
</script>
<template>
......
......@@ -279,7 +279,8 @@ export default {
```
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
export default {
......@@ -292,6 +293,7 @@ export default {
// category: '',
// property: '',
// value: '',
// experiment: '',
// 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