-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a31c09f
commit b4f939d
Showing
1 changed file
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
|
@@ -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) => { | ||
|