Facility
The official snippet is a single <script> tag. No bundler, no npm pipeline. Choose the method suited to your stack.
Standard HTML snippet
To be placed in the <head>, ideally first:
<script src="https://console.palladium-cookies.com/js/palladium.js"
data-site="plm_a9f4e2c7b3"
data-lang="auto"
data-auto-open="true"
defer></script>Supported attributes
| Attribute | Value | Description |
|---|
WordPress
Add this snippet in functions.php of your child theme:
function palladium_inject() { ?>
<script src="https://console.palladium-cookies.com/js/palladium.js"
data-site="plm_a9f4e2c7b3"
defer></script>
<?php }
add_action('wp_head', 'palladium_inject', 1);Next.js / React
Use the <Script> component with strategy="beforeInteractive" so the Blocker takes effect before hydration:
import Script from 'next/script';
export default function Layout({ children }) {
return (
<>
<Script
src="https://console.palladium-cookies.com/js/palladium.js"
data-site="plm_a9f4e2c7b3"
strategy="beforeInteractive"
/>
{children}
</>
);
}Google Tag Manager
Attention : loading Palladium via GTM is risky — the GTM tag generally loads after the first scripts on the page. Prefer a custom HTML tag triggered on Page View – Window Loaded only if your other scripts are also managed by Palladium (category correctly declared via
data-palladium-category).Tagging your third-party scripts
For a third-party script to execute only if the user consents to its category, add the data-palladium-category attribute:
⚠ Remplacer les identifiants d'exemple.
G-XXXXX et 123456789 sont des placeholders ; remplacez-les par vos identifiants Google Analytics et Meta Pixel réels avant déploiement.
<script async
src="https://www.googletagmanager.com/gtag/js?id=G-XXXXX"
data-palladium-category="statistics"></script>
<script data-palladium-category="marketing">
fbq('init', '123456789');
</script>
Without this tagging, Palladium attempts a URL heuristic (Google Analytics, Meta Pixel, Hotjar, etc.) — the list is in palladium.js, Blocker / PATTERNS section.