Custom scripts
Custom scripts let you add your own scripts, HTML, and CSS to every page of your Customer Portal and Storeganise website. You can use them to add a cookie consent banner, load Google Tag Manager after consent, add a chat widget or tracking pixel, or change how your pages look.Note: Custom code never runs in the Management Portal.
Your code is added to every page of your Customer Portal and website the next time each page loads. Every change is recorded in your account history, and all managers get an email saying who made the change.
Each field holds up to 10,000 characters.Note: Other built-in integrations, such as Google Analytics and Segment, also load without waiting for consent. If you need consent for these, clear their fields in Settings > Developer and load them through custom scripts instead.The Then add the stylesheet's domain, for example
Adding a custom code
Only users with the Manager role can view or change custom scripts.- Go to Main settings > Developer > Custom scripts & CSS
- Paste your code into the Head or End of body field.
- Click Save.

Choosing the right field
Where you paste your code decides when it loads.| Field | Where the code goes | Use it for |
|---|---|---|
| Head | The start of the page's <head> , before anything else loads | Cookie consent tools, consent defaults, Google Tag Manager, and anything that must run first |
| End of body | Just before </body> | Chat widgets, pixels, custom styles, and anything that doesn't need to load first |
Setting up cookie consent with Google Tag Manager
In the EU and UK, tracking usually can't start until a visitor gives consent. Your consent tool, such as Cookiebot or Usercentrics, has to load before Google Tag Manager for this to work.- Go to Main settings > Developer and clear the Google Tag Manager ID field. If this field is set, Storeganise loads Tag Manager itself and your consent tool can't control it.
- In the Head field, add your consent tool first and Google Tag Manager after it.
- Click Save.
- Follow your consent tool's own guide for any remaining setup, such as its consent template in Google Tag Manager.
YOUR-COOKIEBOT-ID and GTM-XXXXXXX with your own IDs.<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
analytics_storage: 'denied',
wait_for_update: 500
});
</script>
<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="YOUR-COOKIEBOT-ID" data-blockingmode="auto"></script>
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});
var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';
j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXXX');
</script>
Changing the look with custom styles
Add CSS in the End of body field to change colors, fonts, and other details on your Customer Portal and website. Styles there load after Storeganise's own styles, so yours take priority. Styles in the Head field load first and are usually overridden.This example changes the brand color, uses a Google font, and rounds the buttons:<style>
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;700&display=swap');
html:root {
--brand: #0f766e;
--brand-hover: #115e59;
--brand-dark: #134e4a;
--brand-dark-rgb: 19, 78, 74;
--brand-light: #ccfbf1;
--brand-text: #fff;
--bs-body-font-family: 'DM Sans', sans-serif;
}
.btn {
--bs-btn-border-radius: 999px;
}
</style>
--brand colors come from your brand color in Settings. Changing them updates buttons, links, the header, and highlighted text everywhere at once. --brand-dark-rgb is the same color as --brand-dark , written as three numbers.Linking to an external stylesheet
To load a stylesheet from another site, add a<link> tag:<link rel="stylesheet" href="https://cdn.example.com/my-styles.css">
https://cdn.example.com , to style-src in the Custom CSP section of Main settings > Developer. If the stylesheet loads fonts from another domain, add that domain to font-src too. Google Fonts is already allowed.Tips for custom styles
- Pages are built with Bootstrap 5, so most elements use standard class names such as
.btn,.card, and.navbar. Use your browser's developer tools to find the class of the element you want to change. - Page layouts and class names can change in Storeganise updates. Keep your styles small, and change the
--brandcolors where you can instead of targeting individual elements. - Check your styles on the website and the Customer Portal, on both a phone and a computer.
Security rules for your code
Your Customer Portal and website use a Content Security Policy (CSP) to protect your customers. Most of this is handled for you, but some code works differently from a plain website:- Script and style tags work as normal. Every
<script>and<style>tag in your code is trusted, along with any scripts those tags load. - Inline event handlers are blocked. Attributes such as
onclick="..."andjavascript:links don't run. Add event listeners from a<script>tag instead. - Inline
style="..."attributes may be blocked. Use a<style>tag with class names instead. - Connections to other domains must be allowed. If your code loads data, opens a chat connection, shows an iframe, or loads a stylesheet or font from another domain, add that domain to the Custom CSP section in Settings > Developer. This is usually under
connect-src,frame-src,style-src, orfont-src.
Tracking page views in the Customer Portal
The Customer Portal is a single-page app. Your code runs once, when a visitor first opens it, and doesn't run again as they move between pages inside the portal.To track page views, use a trigger that listens for changes to the page address. In Google Tag Manager, this is the History Change trigger. Website pages are separate page loads, so your code runs on each one.Troubleshooting
Use these checks when custom code doesn't behave as expected:- A page breaks after you add code: add
?nocustomscriptsto the end of the page address, for examplehttps://yourdomain.com/account?nocustomscripts. The page loads without your custom code, so you can confirm whether your code is the cause. - Your code doesn't seem to run: open your browser's developer console and look for errors. CSP errors name the blocked domain you need to allow.
- Your change isn't showing: reload the page fully. Custom code is added when the page first loads, so moving between pages in the Customer Portal won't pick up a change.
Jump to
Related articles
Customise your Content Security Policy
Google Tag Manager examples
Setting up Google Tag Manager (GTM)