Skip to main content

Analytics

Emanates also supports Google Analytics through the NuxtJS Google Analytics plugin. This plugin can be modified directly from the emanates.js config file.

Adding the Google Tag ID#

When a site is setup for analytics on Google Analytics, it is given an unique ID through which google tracks the interactions with the page. This ID needs to be passed to the plugin through the config file.

In the config, add a field googleAnalytics and inside it pass the ID:

module.exports = {    ...    googleAnalytics: {        id: 'your_tag_id'    }}
info

If you don't want to use it, set the value of the field to null.

Advanced setup#

The config object added in the emanates config file emanates.js, is directly passed on as config to the NuxtJS Google Analytics plugin. This means, the user has the full access to pass configuration directly to the module.

This module accepts a few more options that can be found here.

If you want to add those options, just add them to the emanates.js file and they will be passed along to the plugin:

module.exports = {    ...    googleAnalytics: {        id: '',        asyncId: '',        debug: {},        dev: false    }}