Load config.json at runtime
This commit is contained in:
parent
01c0eb503f
commit
589c52f4cd
11 changed files with 71 additions and 39 deletions
|
|
@ -1,12 +1,11 @@
|
|||
import { CleanInsights, ConsentRequestUi } from 'clean-insights-sdk';
|
||||
import config from "../assets/config";
|
||||
|
||||
export default {
|
||||
install(Vue) {
|
||||
|
||||
class RequestUi extends ConsentRequestUi {
|
||||
showForCampaign(campaignId, campaign, complete) {
|
||||
const period = campaign.nextTotalMeasurementPeriod
|
||||
const period = campaign.nextTotalMeasurementPeriod
|
||||
if (!period) {
|
||||
return ''
|
||||
}
|
||||
|
|
@ -27,13 +26,16 @@ export default {
|
|||
}
|
||||
},
|
||||
created() {
|
||||
const analytics = config.analytics || {};
|
||||
if (analytics.enabled && analytics.config) {
|
||||
this.ci = new CleanInsights(analytics.config);
|
||||
this.$config.promise.then(function (config) {
|
||||
const analytics = config.analytics || {};
|
||||
if (analytics.enabled && analytics.config) {
|
||||
this.ci = new CleanInsights(analytics.config);
|
||||
|
||||
// Get name of first campaign in the config.
|
||||
this.campaignId = Object.keys(analytics.config.campaigns || { invalid: {} })[0];
|
||||
}
|
||||
// Get name of first campaign in the config.
|
||||
this.campaignId = Object.keys(analytics.config.campaigns || { invalid: {} })[0];
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
event(category, action) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue