* Add GAM integration & base for GPDR consent * Moved consent to a specific page. * Added functionality to the privacy page, and desactivate tracking if consent is not given. * Added GeoEdge support, and fixed auth issues * Fix actions issue * Fix actions issue, attempt 2 * Added a module for analytics with consent support. * Remove unnecessary function * Add support for runtime config
35 lines
838 B
JavaScript
35 lines
838 B
JavaScript
import {
|
|
DEFAULT_OPTIONS,
|
|
GPT_LIB_SCRIPT_ID,
|
|
GPT_INIT_SCRIPT_ID,
|
|
GEOEDGE_CONF_SCRIPT_ID,
|
|
GEOEDGE_LIB_SCRIPT_ID,
|
|
} from './constants';
|
|
|
|
const { resolve } = require('path');
|
|
|
|
module.exports = async function module(moduleOptions) {
|
|
const options = Object.assign(DEFAULT_OPTIONS, this.options.ads, moduleOptions);
|
|
|
|
const templatesOptions = {
|
|
...options,
|
|
GPT_LIB_SCRIPT_ID,
|
|
GPT_INIT_SCRIPT_ID,
|
|
GEOEDGE_CONF_SCRIPT_ID,
|
|
GEOEDGE_LIB_SCRIPT_ID,
|
|
};
|
|
|
|
this.addPlugin({
|
|
src: resolve(__dirname, 'templates/plugin.js'),
|
|
fileName: 'gpt-ads-module/plugin.js',
|
|
options: templatesOptions,
|
|
});
|
|
|
|
this.addTemplate({
|
|
src: resolve(__dirname, 'templates/component.js'),
|
|
fileName: 'gpt-ads-module/component.js',
|
|
options: templatesOptions,
|
|
});
|
|
};
|
|
module.exports.meta = require('../package.json');
|