title: How to configure gatsby-plugin-google-analytics with cookies consent?
body: <p>I have developed a website using <code>gatsby</code> and I am using google analytics plugin via <code>gatsby-plugin-google-analytics</code>, now to be nice with the users, I would like to add a cookie consent where the user will be two options whether to accept or decline cookies usages. If the user declines then I would like to stop google analytics to track the user activity. I dug into their documentation but unable to find the option to achieve this, is there any way around to achieve this.</p>
  
  <pre><code>{
    resolve: `gatsby-plugin-google-analytics`,
    options: {
      trackingId: siteConfig.googleAnalyticsId,
      // Defines where to place the tracking script - `true` in the head and `false` in the body
      head: false,
    },
  },
  </code></pre>
  
  <p>For the movement my <code>gatsby-config.js</code> looks like this. how one can achieve this.</p>
  
  <p>Thanks you in advance.</p>