# Analytics

If you’d like to track traffic or integrate services like Google Analytics or Google Tag Manager, you’ll need to add their code snippets to your project. Where you add the code depends on whether you want it to apply to all pages or just one.

{% hint style="success" %}

### **Recommended Analytics Service (GDPR Compliant)**

We recommend using [Fathom Analytics](https://usefathom.com/ref/81P61Z), it's much easier to understand and use compared to Google Analytics. **Fathom is GDPR compliant and doesn’t require cookie notices**.
{% endhint %}

{% embed url="<https://www.youtube.com/watch?v=sfzIONiv2zY&feature=youtu.be>" %}

### For all pages (site-wide tracking)

To include your tracking code on every page of your site:

1. Open the Site Settings window.
2. Select the Template section.
3. Paste your code into either:
   * Between the `<head>` tags for anything that belongs in the \<head>, such as Google Analytics or similar.
   * Between the after the opening `<body>` tag for things like Google Tag Manager’s \<noscript> block.

This ensures your tracking code is included automatically across every page.

<figure><img src="/files/Fq579cJjaJZ9sksu4fFw" alt=""><figcaption><p>Adding site wide code into the Templates area.</p></figcaption></figure>

### For individual pages

If you only want to add tracking code to a specific page:

1. Select the page in the sidebar.
2. Click the Edit Extra Code button in the page Inspector
3. Choose the correct code area from the list on the left (e.g. Head Start, Body Start).
4. Paste your code snippet in the appropriate section.

The code will only be included on that specific page when you publish or preview your site.

<figure><img src="/files/IO0oXrf1EvIeV5Q2FPMZ" alt=""><figcaption><p>Adding code into a specific page.</p></figcaption></figure>


---

# 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://docs.realmacsoftware.com/elements-docs/elements/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.
