<head> or at the end of the
Most analytics providers, retargeting services, and A/B testing services will give you an HTML snippet and ask you to add it to every page on your site.
Netlify lets you do this without having to pollute the source code for the site with production specific analytics snippets.
From the site Build & Deploy Settings page, find the “Snippet Injection” section in the “Post processing” portion of the page, and click “Add Snippet”. Then give your script a name and paste the script body (including any
<script> tags, etc).
Netlify lets you pick between injecting the scripts in before the closing
</head> tag or before the closing
Note, scripts injected in this way will also show up on the
password protection screen. This means you can easily verify that your analytics scripts are correctly configured without having to remove the password when your site is still under development.
Notice something is incorrect or outdated?
First off, great eye! We appreciate your discovery and want to ensure it gets addressed immediately. Please let us know here.