# Analytics

{% hint style="info" %}
Analytics scripts might not be as useful as you think, as most ad blocker extensions now prevent them from working, potentially limiting your data to only a small subset of your visitors.
{% endhint %}

There are many available analytics services, the most well-known being Google Analytics. They each work slightly differently, but they all should have a way to obtain a snippet of code that you can paste into the pages that you want to track.

The snippet will generally look something like this, a minimal `<script>` tag with an ID unique to you:

```html
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX-X"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'UA-XXXXXXXX-X');
</script>
```

Once you've found this code snippet for your analytics service, paste it into `/_includes/analytics.html` to include it on every page on your site.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://greene-lab.gitbook.io/lab-website-template-docs/advanced/analytics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
