mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
Space Junk Analytics: Remove Plausible Code + Details (#1801)
* removing plausible-based code --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -14,8 +14,8 @@
|
|||||||
<p>Celebrate our official launch with a 20% discount on a Web Awesome Pro plan…<span class="appearance-underlined variant-drawn" style="--underline-color: var(--wa-color-brand);">for life</span>! But hurry, this lifetime discount is only available for a limited time.</p>
|
<p>Celebrate our official launch with a 20% discount on a Web Awesome Pro plan…<span class="appearance-underlined variant-drawn" style="--underline-color: var(--wa-color-brand);">for life</span>! But hurry, this lifetime discount is only available for a limited time.</p>
|
||||||
|
|
||||||
<div class="wa-split">
|
<div class="wa-split">
|
||||||
<wa-button type="button" appearance="plain" data-dialog="close" class="plausible-event-name=launch_dialog:close_button_click">Maybe Later</wa-button>
|
<wa-button type="button" appearance="plain" data-dialog="close">Maybe Later</wa-button>
|
||||||
<wa-button variant="neutral" appearance="accent" href="/purchase" class="brand-font plausible-event-name=launch_dialog:pro_purchase_button_click">
|
<wa-button variant="neutral" appearance="accent" href="/purchase" class="brand-font">
|
||||||
<wa-icon slot="start" variant="regular" name="rocket-launch"></wa-icon>
|
<wa-icon slot="start" variant="regular" name="rocket-launch"></wa-icon>
|
||||||
Get Pro + Save 20%
|
Get Pro + Save 20%
|
||||||
</wa-button>
|
</wa-button>
|
||||||
@@ -43,13 +43,6 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper function to safely track Plausible events
|
|
||||||
const trackEvent = (eventName) => {
|
|
||||||
if (typeof plausible !== 'undefined') {
|
|
||||||
plausible(eventName);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Initialize dialog functionality
|
// Initialize dialog functionality
|
||||||
let initCalled = false;
|
let initCalled = false;
|
||||||
const initDialog = () => {
|
const initDialog = () => {
|
||||||
@@ -59,19 +52,8 @@
|
|||||||
}
|
}
|
||||||
initCalled = true;
|
initCalled = true;
|
||||||
|
|
||||||
// Track when dialog is shown
|
// Save dismissal state when dialog is hidden
|
||||||
dialog.addEventListener('wa-show', () => {
|
|
||||||
trackEvent('launch_dialog:view');
|
|
||||||
}, { once: true });
|
|
||||||
|
|
||||||
// Track when dialog is dismissed
|
|
||||||
dialog.addEventListener('wa-hide', (event) => {
|
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
|
// Save dismissal state to localStorage
|
||||||
try {
|
try {
|
||||||
localStorage.setItem(SITE_DIALOG_DISMISSED_KEY, 'true');
|
localStorage.setItem(SITE_DIALOG_DISMISSED_KEY, 'true');
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
<script type="module" src="/assets/scripts/color-scheme.js"></script>
|
<script type="module" src="/assets/scripts/color-scheme.js"></script>
|
||||||
<script type="module" src="/assets/scripts/theme.js"></script>
|
<script type="module" src="/assets/scripts/theme.js"></script>
|
||||||
{% if hasSidebar %}<script type="module" src="/assets/scripts/sidebar.js"></script>{% endif %}
|
{% if hasSidebar %}<script type="module" src="/assets/scripts/sidebar.js"></script>{% endif %}
|
||||||
<script defer data-domain="webawesome.com" src="https://plausible.io/js/script.js"></script>
|
|
||||||
|
|
||||||
{% block head %}
|
{% block head %}
|
||||||
<link rel="stylesheet" href="/assets/styles/docs.css" />
|
<link rel="stylesheet" href="/assets/styles/docs.css" />
|
||||||
|
|||||||
Reference in New Issue
Block a user