Skip to content

Commit

Permalink
feat: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Apr 11, 2024
1 parent a31c09f commit b4f939d
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ <h2>YouTube Modal Example</h2>
document.addEventListener("consenty:click", (e) => {
const prop = "youtube-modal";
if (e.detail !== prop) return;
if (consenty.isAllowed(prop)) {
if (consenty.isTrue(prop)) {
consenty
// this loads markup from within <template>
.load(prop)
Expand Down Expand Up @@ -497,6 +497,30 @@ <h3>change</h3>
});
</script>

<hr />

<h2>API Usage</h2>

<p>
When using page transition libraries like barba.js you need to send
pageviews manually to your tracking software. If the user revoke
consent you are not allowed to do so!
</p>

<script
class="code"
data-lang="js"
>
if (consenty.isTrue("matomo-optout")) {
// user chose to opt-out from tracking
// do nothing
} else {
// user allowed to collect statistics
// send pageview event to matomo
_paq.push(["trackPageView"]);
}
</script>

<script type="module">
import { codeToHtml } from "https://esm.sh/[email protected]";
document.querySelectorAll(".code").forEach((element) => {
Expand Down

0 comments on commit b4f939d

Please sign in to comment.