# Guest Gate Theme Component

**URL:** <https://meta.discourse.org/t/guest-gate-theme-component/225107>\
**Category:** Theme component\
**Created:** [April 23, 2022, 8:31pm UTC](https://meta.discourse.org/t/guest-gate-theme-component/225107 "2022-04-23T20:31:54Z")\
**Posts on this page:** 1\
**Showing post:** 162

<div class="post-metadata">

**Author:** ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)\
**Post date:** [August 22, 2026, 2:06pm UTC](https://meta.discourse.org/t/guest-gate-theme-component/225107/162 "2026-08-22T14:06:07Z")

</div>

I have implemented an analytics tracking system for the Guest Gate v2.0 with full GTM (Google Tag Manager) support and flexible custom event logging.

#### Settings Added

- **`enable_analytics`** _(disabled by default)_: Toggles the entire tracking functionality on or off as requested.

- **`analytics_debug_logging`** : When enabled, logs all tracked events directly to the browser console. This is especially helpful during setup when configuring GTM triggers.

#### Core Functionality

A dedicated helper module (`guest-gate-analytics.js`) handles event dispatching. Every tracked event is pushed to two destinations simultaneously:

1. **`window.dataLayer.push(...)`**: Automatically picked up by Google Tag Manager (GTM) and Google Analytics 4 (GA4) if active on the site.

2. **`discourse-guest-gate:analytics`** _(Custom Browser Event)_: Allows integration with third-party tools (e.g., Matomo, Plausible, or custom webhooks) without requiring any further code modifications.

#### Events Tracked

- **`guest_gate_shown`** _(Fired when the modal appears)_

- **`guest_gate_click`** _(Fired when the visitor interacts with the modal)_

#### Privacy & Data Protection

- **No personally identifiable information (PII) is collected or transmitted**, only the minimal operational metadata listed above.

* * *

Coming soon…🚀

[\> ./support --coffee](https://meta.discourse.org/u/don)

---

_[View the full topic](https://meta.discourse.org/t/guest-gate-theme-component/225107)._
