> ## Documentation Index
> Fetch the complete documentation index at: https://getfaceage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Analytics

> Track every step of the scan in Google Analytics, Tag Manager or Facebook Pixel.

Connect Google Analytics, Tag Manager or Facebook Pixel by passing your IDs as options.

```js Google Analytics / GTM theme={null}
const faceAge = new FaceAge({
  elementId: 'FaceAge-module',
  faceageId: '<Your Client ID>',
  gtag: 'G-XXXXXXXXXX',            // G-..., GT-..., or GTM-... format
  gtagInsert: true,                // auto-inject GTM script (default: true)
  gtagDataLayer: window.dataLayer, // optional: use a custom dataLayer
});
```

```js Facebook Pixel theme={null}
const faceAge = new FaceAge({
  elementId: 'FaceAge-module',
  faceageId: '<Your Client ID>',
  fbPixel: '123456789012345', // your numeric Pixel ID
  fbPixelInsert: true,        // auto-inject Pixel script (default: true)
});
```

| Option | Type | Default | Description |
| - | - | - | - |
| `gtag` | `String` | — | Google Analytics or Tag Manager ID (`G-…`, `GT-…` or `GTM-…`). |
| `gtagInsert` | `Boolean` | `true` | Inject the GTM script automatically. Turn off if your site already loads it. |
| `gtagDataLayer` | `Array` | — | Use a custom `dataLayer`. |
| `fbPixel` | `String` | — | Your numeric Facebook Pixel ID. |
| `fbPixelInsert` | `Boolean` | `true` | Inject the Pixel script automatically. |

## Tracked events

With `gtag` set, the SDK pushes an event to the `dataLayer` at every step — quiz, photo, results, report, products, routines, cart and checkout. See [Analytics events](https://getfaceage.com/docs/analytics/events.md) for the full list, what each one means, and how to send them to GA4 with Google Tag Manager.

> [!NOTE]
>
> With `fbPixel`, the SDK loads your Pixel and sends a `PageView`. The step-by-step scan events go to the `dataLayer` only — to send them to Meta, forward them with a Meta Pixel tag in Google Tag Manager, or call `fbq` from the SDK's [events](https://getfaceage.com/docs/developer-guides/integrations/events.md).

## Next

> [card] [CRM integration](https://getfaceage.com/docs/developer-guides/integrations/crm.md)
>
> Send the full analysis to your CRM or backend.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.