feat(analytics): add Plausible custom-event markings for six goals

Mark the six conversion goals on the self-hosted Plausible instance so the
events match the goals to be registered in Plausible. Event names verbatim:
Trial, FAQ, Buy, Custom Quote, search posts, Project Plan.

CSS-class markings (work without JS logic, on the clickable element):
- FAQ  -> index/de/es index .faq-card; odoo-hosting-2027 + odoo-community-upgrade
          (de/es twins) and australia <summary>; support.html .faq-question
- Buy  -> index/de/es index .btn-buy anchors; australia + bootcamp native
          post_basket submit buttons (forms stay native POST)

JS call markings in script.js (loaded by index, de/index, es/index):
- Trial        on the successful trial-form POST (.then branch)
- Custom Quote on the successful custom-quote POST (.then branch)
- Project Plan on the successful business-wizard submit
- search posts on the FIRST input of #blogSearch only (guard flag, one per
  pageview, not on every keystroke, not on #ocaSearch)

Nothing fires on page load; the 'Start the free trial' anchors that only
scroll to #trialCard are deliberately not tagged. One goal per topic across
all languages, no language suffix. No visual, behavioural or request change.
This commit is contained in:
webmaster committed 2026-10-28 21:07:19 +00:00
1 parent ea97e65416
commit 73b3f34696
13 files changed
+104 -96

No files matched your search

+8
View File
@@ -623,6 +623,7 @@ var si = 0,
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(UTM.inject({ email: email, location: location }))
}).then(function() {
if (window.plausible) window.plausible('Trial');
trialForm.style.display = 'none';
document.getElementById('trialSuccess').classList.add('visible');
}).catch(function() {
@@ -651,9 +652,14 @@ var si = 0,
'<div class="blog-empty">Could not load blog posts.</div>';
});
var blogSearchTracked = false;
document
.getElementById("blogSearch")
.addEventListener("input", function () {
if (!blogSearchTracked) {
blogSearchTracked = true;
if (window.plausible) window.plausible('search posts');
}
blogState.searchTerm = this.value;
blogState.currentPage = 1;
renderBlog();
@@ -737,6 +743,7 @@ var si = 0,
}).catch(function () { /* ignore */ });
/* Show success message — we'll email the report */
if (window.plausible) window.plausible('Project Plan');
form.style.display = 'none';
success.style.display = 'block';
});
@@ -898,6 +905,7 @@ var si = 0,
}))
}).then(function(r) {
if (!r.ok) throw new Error('bad status ' + r.status);
if (window.plausible) window.plausible('Custom Quote');
customQuoteForm.style.display = 'none';
document.getElementById('customQuoteSuccess').style.display = 'block';
submitBtn.textContent = 'Submit Request';