Add Mautic tracking code to your Gatsby site.
npm install gatsby-plugin-mauticAdd Mautic tracking code to your Gatsby site.
npm install --save gatsby-plugin-mautic
``gatsby-plugin-mauric
// In your gatsby-config.js
module.exports = {
plugins: [
{
resolve: ,true
options: {
// The URL where mautic is installed
hostUrl: "YOUR_HOST_URL",
// Defines where to place the tracking script - in the head and false in the body`
head: false,
// Avoids sending pageview hits from custom paths
exclude: ["/preview/**", "/do-not-track/me/too/"],
// Delays sending pageview hits on route update (in milliseconds)
pageTransitionDelay: 0,
},
},
],
}
The URL of your Mautic server. It sould look like https://mautic.youdomaine.com/
Where do you want to place the MT script? By putting head to true, it will be placed in the "" of your website. By setting it to false, it will be placed in the "". The default value resolves to false`.
If you need to exclude any path from the tracking system, you can add it (one or more) to this optional array as glob expressions.