← Back to TinyConsent
Documentation
Integration

Embed Options

Multiple ways to integrate TinyConsent cookie banner into your website or application.

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

Use "Insert Headers and Footers" plugin
Add to theme's functions.php
Compatible with caching plugins
// 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

Edit theme.liquid file
Add before </head>
Works with all Shopify themes
<!-- theme.liquid -->
<script src="https://scripts.tinyconsent.com/api/scripts/YOUR_ID" async></script>
</head>

Next.js

Use Next.js Script component
Set strategy to "afterInteractive"
Works with App Router and Pages Router
// layout.tsx
import Script from 'next/script';

<Script
  src="https://scripts.tinyconsent.com/api/scripts/YOUR_ID"
  strategy="afterInteractive"
/>

Other CMS

Squarespace: Code Injection
Wix: Custom Code in Settings
Webflow: Project Settings

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.