For Your Web Developer

Technical details for installing Nizam on a website, including security settings and cookie consent.

This page is for the person who looks after your organization's website. It covers what the embed code does, what to allow in a Content Security Policy, and how Nizam follows your cookie banner. For the basic steps, see Install the embed code.

What the Embed Code Does, copy link to this section

The embed code is a short inline script that belongs in the <head> of every page. It loads Nizam's script from https://cdn.nizam.co asynchronously, so it never blocks your page from rendering. It also fetches your organization's element settings at the same time.

Copy the code from Settings → Website → Embed code. Each organization's code is unique, and only its last line differs between organizations.

  • Loading twice is safe. If the code appears more than once on a page, for example in Google Tag Manager and in the theme, Nizam loads once.
  • Changes need no redeploy. Element settings are read when the page loads, so changes made in the dashboard reach your site without touching the code.
  • Single-page apps are supported. Nizam follows history navigation, so page views are counted and Visibility rules for Sticky Buttons, Social Proof and Reminders are checked again on each route change.
  • If Nizam can't load, for example because of an ad blocker or a strict policy, your page carries on as normal. Nothing on your site breaks.

Placing Elements, copy link to this section

Buttons, Grids and QR Codes are placed with a custom tag:

html
<nizam-element id="el_xxxxxxxx"></nizam-element>

If your content management system (CMS) strips unknown tags, link to the element's ID instead. Nizam handles the click:

html
<a href="#el_xxxxxxxx">Donate</a>

Sticky Buttons, Social Proof and Reminders have no tag. Nizam places them based on the rules set in the dashboard.

The checkout opens in an iframe over your page. Because the iframe is on your own domain, it follows your page's Content Security Policy.

Security Settings, copy link to this section

If your site sends a Content-Security-Policy header, allow these origins:

DirectiveOriginsFor
script-srchttps://cdn.nizam.coThe embed script and its parts
connect-srchttps://cdn.nizam.co, https://api.nizam.co, https://nizam.linkElement settings, the checkout and analytics. Without nizam.link, donations still work, but visits aren't recorded
style-srchttps://fonts.googleapis.comThe checkout's typeface
font-srchttps://fonts.gstatic.comThe checkout's typeface

Payments are processed by Stripe, so also follow Stripe's Content Security Policy guidance for Stripe.js.

Nizam sets its cookies on your own domain as first-party cookies. It follows your visitors' consent choices in this order:

  1. Your own call. Tell Nizam the visitor's choice directly. This works before the script has loaded:

    javascript
    Nizam('set', 'consent', 'pending')                       // your banner hasn't answered yet
    Nizam('set', 'consent', { analytics: true, ads: false }) // the visitor's answer

    Once your page uses this, it's the only signal Nizam listens to.

  2. Google Consent Mode. If your cookie banner feeds Google Consent Mode (OneTrust, Cookiebot, CookieYes and most others do), Nizam follows it with no extra code. analytics_storage controls Nizam's analytics. ad_storage and ad_user_data control whether Nizam reads advertising identifiers. Set one global default, because region-specific defaults aren't read.

  3. Neither. Analytics is on.

When a visitor refuses analytics, Nizam stops recording their visits and deletes its analytics cookie. It keeps one strictly necessary cookie to protect the checkout from fraud. Nizam also honors Global Privacy Control: when a browser sends it, advertising identifiers are never read or stored.

Nizam sets no marketing cookies.

Checking the Install, copy link to this section

Open a page with an element on it, click the element, and start a donation in the checkout. Once a donation has started on your site, your domain appears under Settings → Website → Embed installs in the dashboard. Apple Pay and Google Pay are registered for that domain automatically.

If Nizam doesn't load

Open your browser's developer console on the page. A blocked request to cdn.nizam.co, api.nizam.co or nizam.link means your Content Security Policy needs the origins in Security Settings. If nothing is blocked, send us the page address and what you see.