Analytics

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.

How to configure Blogtally Pulse

Open the file app.config.ts and configure the analytics property:

    analytics: {
        providers: [ {
            provider: 'blogtally',
            code: 'YOUR_BLOGTALLY_CODE'
        }]
    }
Replace YOUR_BLOGTALLY_CODEwith the code provided by Blogtally.

How to configure Google Analytics

Open the file app.config.ts and configure the analytics property:

    analytics: {
        providers: [ {
            provider: 'google',
            code: 'YOUR_GOOGLE_ANALYTICS_ID'
        }]
    }
Replace YOUR_GOOGLE_ANALYTICS_ID with your Google Analytics ID.

How to configure Fathom

Open the file app.config.ts and configure the analytics property:

analytics: {
    providers: [ {
        provider: 'fathom',
        code: 'YOUR_FATHOM_CODE'
    }]
}
Replace YOUR_FATHOM_CODE with your Fathom code.

How to configure Pirsch

Open the file app.config.ts and configure the analytics property:

analytics: {
    providers: [ {
        provider: 'pirsch',
        code: 'YOUR_PIRSCH_CODE'
    }]
}
Replace YOUR_PIRSCH_CODE with your Pirsch code.

How to configure Plausible

Open the file app.config.ts and configure the analytics property:

analytics: {
    providers: [ {
        provider: 'plausible',
        code: 'YOUR_PLAUSIBLE_CODE'
    }]
}
Replace YOUR_DOMAIN with your domain
Note that you can add multiple analytics tools by adding more objects to the providers array.

How to add another analytics tool

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');
                    `,
                },
            ],
        },
    },
}