Install
PrestaShop, Joomla, Drupal and Next.js
Where to place the CookieTrue line in PrestaShop, Joomla, Drupal and Next.js or React, and how to clear caches afterwards.
For these systems you edit a template file that every page shares. Copy your line from Installation in the dashboard and paste it as the first element inside <head>.
<script id="cookietrue" src="https://cdn.cookietrue.com/s/ct_yoursiteid.js"></script>#PrestaShop
- Open your theme folder and edit
templates/_partials/head.tpl. - Paste the line at the very top of that file.
- Clear the cache under Advanced Parameters → Performance.
Update your theme later? A theme update can overwrite the file. Use a child theme to keep the change.
#Joomla
- Open System → Site Templates and choose your template.
- Edit
index.phpand paste the line as the first thing after<head>. - Click Save & Close, then clear the cache under System → Clear Cache.
#Drupal
- Open your theme's
html.html.twigtemplate. If your theme has none, copy it from the core theme into your theme folder. - Paste the line as the first thing after
<head>. - Clear the cache under Configuration → Performance.
#Next.js and React
In Next.js, add a plain script tag as the first element of <head>. Do not use next/script, because that loads scripts later than the browser would on its own.
// app/layout.tsx
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
<script id="cookietrue" src="https://cdn.cookietrue.com/s/ct_yoursiteid.js" />
</head>
<body>{children}</body>
</html>
);
}On the Pages Router, put the same tag in pages/_document.tsx inside <Head>.
For a single-page app built with Vite or Create React App, put the line into index.html, at the top of <head>.
#After you deploy
Open the live website in a private window to check the banner. See Troubleshooting if it does not appear.