Connect analytics and ad tracking
set_tracking_codesConnect the owner's own Google Analytics 4, Google Tag Manager, Meta Pixel or Plausible to their published site. Takes an ID — or the snippet the owner pasted, from which the ID is extracted — never arbitrary script. Omitted providers are kept; null disconnects one. Live on every public page at once, no publish needed (never on preview links). Use only IDs the owner gave you. Sitelas has its own visitor analytics (get_analytics); this is for owners who want their numbers in those tools, or to measure ads. Where the owner's visitors are in the EU/UK, tell them these tools may need a cookie consent banner.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site_id | Yes | The site to connect. | |
| plausible | No | Plausible site domain (`example.com`). Pass the ID or the whole snippet the owner pasted — the ID is extracted and checked. `null` disconnects it. | |
| meta_pixel | No | Meta (Facebook) Pixel ID, 10–20 digits. Pass the ID or the whole snippet the owner pasted — the ID is extracted and checked. `null` disconnects it. | |
| google_analytics | No | Google Analytics 4 Measurement ID (`G-XXXXXXXXXX`). Pass the ID or the whole snippet the owner pasted — the ID is extracted and checked. `null` disconnects it. | |
| google_tag_manager | No | Google Tag Manager container ID (`GTM-XXXXXXX`). Pass the ID or the whole snippet the owner pasted — the ID is extracted and checked. `null` disconnects it. |