You can add any analytics tool to your blog.
By default, X comes with built-in integrations to work with:
but you can add any other analytics tool.
Open the file app.config.ts and configure the analytics property:
analytics: {
providers: [ {
provider: 'hakanai',
code: 'YOUR_HAKANAI_CODE'
}]
}
YOUR_HAKANAI_CODEwith the code provided by Hakanai.Open the file app.config.ts and configure the analytics property:
analytics: {
providers: [ {
provider: 'google',
code: 'YOUR_GOOGLE_ANALYTICS_ID'
}]
}
YOUR_GOOGLE_ANALYTICS_ID with your Google Analytics ID.Open the file app.config.ts and configure the analytics property:
analytics: {
providers: [ {
provider: 'fathom',
code: 'YOUR_FATHOM_CODE'
}]
}
YOUR_FATHOM_CODE with your Fathom code.Open the file app.config.ts and configure the analytics property:
analytics: {
providers: [ {
provider: 'pirsch',
code: 'YOUR_PIRSCH_CODE'
}]
}
YOUR_PIRSCH_CODE with your Pirsch code.Open the file app.config.ts and configure the analytics property:
analytics: {
providers: [ {
provider: 'plausible',
code: 'YOUR_PLAUSIBLE_CODE'
}]
}
YOUR_DOMAIN with your domainproviders array.You have to modify the nuxt.config.ts file to add the script of the analytics tool.
For example, let's say GA is not supported by Bloggrify (it is, but let's pretend it's not). To add Google Analytics, you can add the following script:
export default {
app: {
head: {
script: [
{
src: 'https://www.googletagmanager.com/gtag/js?id=YOUR_GOOGLE_ANALYTICS_ID',
async: true,
},
{
innerHTML: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'YOUR_GOOGLE_ANALYTICS_ID');
`,
},
],
},
},
}