diff --git a/packages/webawesome/docs/_includes/_dialog-wa-launch.njk b/packages/webawesome/docs/_includes/_dialog-wa-launch.njk
index a33276141..e1ddbeb19 100644
--- a/packages/webawesome/docs/_includes/_dialog-wa-launch.njk
+++ b/packages/webawesome/docs/_includes/_dialog-wa-launch.njk
@@ -1,97 +1,95 @@
-
+{% raw %}
+ {%- if req.stripe.discount.active and not currentUser.hasPro -%}
+
-
+
-
-
-
Get a lifetime discount on Web Awesome Pro!
-
-
+
+
+
Get a lifetime discount on Web Awesome Pro!
+
+
-
-
Celebrate our official launch with a 20% discount on a Web Awesome Pro plan…for life! But hurry, this lifetime discount is only available for a limited time.
+
+
Celebrate our official launch with a 20% discount on a Web Awesome Pro plan…for life! But hurry, this lifetime discount is only available for a limited time.
-
- Maybe Later
-
-
- Get Pro + Save 20%
-
-
-
-
+
+ Maybe Later
+
+
+ Get Pro + Save 20%
+
+
+
+
-
+ // Helper function to safely track Plausible events
+ const trackEvent = (eventName) => {
+ if (typeof plausible !== 'undefined') {
+ plausible(eventName);
+ }
+ };
+ // Initialize dialog functionality
+ let initCalled = false;
+ const initDialog = () => {
+ // Prevent double initialization
+ if (initCalled) {
+ return;
+ }
+ initCalled = true;
+
+ // Track when dialog is shown
+ dialog.addEventListener('wa-show', () => {
+ trackEvent('launch_dialog:view');
+ }, { once: true });
+
+ // Track when dialog is dismissed
+ dialog.addEventListener('wa-hide', (event) => {
+ // Track overlay click or Escape key dismissal
+ // Button clicks are tracked via CSS classes, so we only track non-button dismissals
+ if (event.detail?.source === dialog) {
+ trackEvent('launch_dialog:overlay_click');
+ }
+
+ // Save dismissal state to localStorage
+ try {
+ localStorage.setItem(SITE_DIALOG_DISMISSED_KEY, 'true');
+ } catch (e) {
+ // localStorage may be disabled or unavailable
+ }
+ }, { once: true });
+
+ // Show dialog after a short delay to ensure page is loaded
+ setTimeout(() => {
+ dialog.open = true;
+ }, 500);
+ };
+
+ customElements.whenDefined("wa-dialog").then(() => {
+ initDialog()
+ })
+ })();
+
+ {%- endif -%}
+{% endraw %}
diff --git a/packages/webawesome/docs/_includes/base.njk b/packages/webawesome/docs/_includes/base.njk
index 96b6f1094..26b50c2b1 100644
--- a/packages/webawesome/docs/_includes/base.njk
+++ b/packages/webawesome/docs/_includes/base.njk
@@ -139,11 +139,7 @@
{#- Site-Wide Dialog -#}
{% if hasSiteDialog %}
- {% raw %}
- {%- if not currentUser.hasPro -%}
- {% include "_dialog-wa-launch.njk" ignore missing %}
- {%- endif -%}
- {% endraw %}
+ {% include "_dialog-wa-launch.njk" ignore missing %}
{% endif %}
{# Footer #}