Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated plausible logging to more useful iframe url instead of "srcdoc" #1580

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<head>
<script defer
data-domain="preview.boost.org"
src="https://plausible.io/js/script.js"></script>
src="https://plausible.io/js/script.manual.js"></script>
<title>{% block title %}Boost{% endblock %}</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Expand Down Expand Up @@ -547,12 +547,21 @@
}
}

const manualPlausibleTrigger = async () => {
window.plausible = window.plausible || function() {
(window.plausible.q = window.plausible.q || []).push(arguments)
}
let loc = window.parent.location.href || window.location.href;
plausible("pageview", { u: loc + window.location.search });
};

window.addEventListener('DOMContentLoaded', () => {
// resets the form on back button press
document.getElementById("id_category")?.closest('form').reset();
document.getElementById("id_version")?.closest('form').reset();
document.getElementById("id_category")?.addEventListener("change", changeVersionAndCategory);
document.getElementById("id_version")?.addEventListener("change", changeVersionAndCategory);
manualPlausibleTrigger();
});
(async () => {
await trackLoginUpdateCheck();
Expand Down
2 changes: 1 addition & 1 deletion templates/docsiframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% block content %}
<iframe
href="{{ content_url }}" srcdoc="{{ content }}"
srcdoc="{{ content }}"
onload="iframeCustomizations(this)"
id="docsiframe"
></iframe>
Expand Down
Loading