You've already forked AstralRinth
forked from didirus/AstralRinth
Change ads provider, and add consent system for advertising (#155)
* 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
This commit is contained in:
22
modules/analytics/lib/module.js
Normal file
22
modules/analytics/lib/module.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import {
|
||||
DEFAULT_OPTIONS,
|
||||
UNAMI_LIB_TAG_ID
|
||||
} from './constants';
|
||||
|
||||
const { resolve } = require('path');
|
||||
|
||||
module.exports = async function module(moduleOptions) {
|
||||
const options = Object.assign(DEFAULT_OPTIONS, this.options.analytics, moduleOptions);
|
||||
|
||||
const templatesOptions = {
|
||||
...options,
|
||||
UNAMI_LIB_TAG_ID
|
||||
};
|
||||
|
||||
this.addPlugin({
|
||||
src: resolve(__dirname, 'templates/plugin.js'),
|
||||
fileName: 'analytics/plugin.js',
|
||||
options: templatesOptions,
|
||||
});
|
||||
};
|
||||
module.exports.meta = require('../package.json');
|
||||
Reference in New Issue
Block a user