Universal Script Tag (Recommended)
One Method, Works Everywhere
The script tag method works on any website, regardless of technology. Just add this to your HTML head:
<script src="https://scripts.tinyconsent.com/api/scripts/YOUR_SCRIPT_ID" async></script>
Why this method? Zero dependencies, maximum compatibility, automatic updates, and optimized loading.
Platform-Specific Integrations
WordPress
functions.php// functions.php
function add_tinyconsent() {
echo '<script src="https://scripts.tinyconsent.com/api/scripts/YOUR_ID" async></script>';
}
add_action('wp_head', 'add_tinyconsent', 1);Shopify
</head><!-- theme.liquid --> <script src="https://scripts.tinyconsent.com/api/scripts/YOUR_ID" async></script> </head>
Next.js
// layout.tsx import Script from 'next/script'; <Script src="https://scripts.tinyconsent.com/api/scripts/YOUR_ID" strategy="afterInteractive" />
Other CMS
Most platforms support custom HTML/script injection in their settings or theme editors.
Advanced Integration Options
JavaScript API
Programmatically control consent and check status:
// Check consent
const hasAnalytics = window.TinyConsent?.hasConsent('analytics');
// Listen for changes
window.addEventListener('tinyconsent:change', () => {
console.log('Consent updated');
});Custom Blocking Rules
Define custom scripts to block until consent:
// Dashboard configuration // Block custom analytics <script data-consent="analytics" src="custom-analytics.js"></script> // Block marketing pixels <img data-consent="marketing" src="tracking-pixel.png" />
Frequently Asked Questions
What are the different ways to embed TinyConsent?
You can embed TinyConsent using: script tag (universal), WordPress plugins, CMS integrations, or custom JavaScript implementations.
Which embed method should I use?
Use the script tag method for maximum compatibility. It works on any website and doesn't require platform-specific setup.
Can I use TinyConsent with my CMS?
Yes, TinyConsent works with WordPress, Shopify, Squarespace, Wix, Webflow, and most other CMS platforms.
Do different embed methods affect performance?
The script tag method is optimized for performance. CMS plugins may add slight overhead but still load asynchronously.
Can I switch embed methods later?
Yes, you can change how TinyConsent is embedded without losing your settings or consent data.
Related Documentation
Ready to Embed TinyConsent?
Choose the integration method that works best for your platform and get compliant in minutes.