All Collections
Customize your nation
Set up an analytics consent banner for your website
Set up an analytics consent banner for your website

This will guide you through the process of setting up an analytics/cookie consent banner if you're using analytics tools on your site.

Updated over a week ago

📌 This documentation is about our legacy banner offering. If you didn’t have a cookie banner configured before July 14th, 2021 please read our new cookie banner documentation.

Table of Contents

Watch a video

Where to start

NationBuilder believes that your data belongs to you and as such, we have aligned our product to collect consent for data collection at all levels, so there are no default opt-ins. This will guide you through the process of setting up an analytics/cookie consent banner for public themes if you're using the analytics tools Google Analytics or Chartbeat on your NationBuilder site. Enabling this banner will allow the people who visit your site to formally consent to the collection of data by those analytics tools. The cookie will not be created by those tools unless site visitors consent by using the 'Accept' button. 

The Analytics Banner tool does not collect consent for any cookies that may be created when you embed 3rd party consent or use 3rd party integrations in your nation. The tool also does not collect consent for NationBuilder's application cookies.

Please note, this is an optional feature and is currently only available for public themes. 

You need to enable advanced privacy (Settings > Defaults > Basic > Enable advanced privacy) before you can use the banner. 

Set up cookie consent subject

Before you can utilize the banner, you need to set up a cookie consent subject. Once this is set up, the system can store data for the people who consent via the banner. Go to Settings > Privacy > Consents

To create your consent subject:

1. Give the consent a name, e.g. Banner-Cookies.

2. The slug will auto-populate to match the name you've chosen, you can change this if you wish.

3. Select the consent Processing Type (Cookie) via the dropdown menu.

Please note, you can also create consent that is general and not specifically mapped to the email/SMS/Match processing types. For example, if you'd like to gain consent for postal mail just give the consent a name/slug like "Postal mail" and click Create consent (without selecting a processing type).

4. Click Create consent. Now you can enable your consent banner. 

Enabling the consent banner

To enable the banner, click on Website and select your site. Click on Site settings > Analytics setup

1. Enter your Google analytics code and Google site verification key OR your Chartbeat API key and Chartbeat UID. 

2. Click on the checkbox that states, "Ask visitors to accept analytic cookies."

3. Select your consent subject (this must be set up ahead of time). You will be able to use this consent subject later to filter on the people who consented or did not consent to the banner. Also, write out your Description, i.e. what the banner will say to people who visit your site. 

As seen in the tip above, you can add a link to your banner (such as to your privacy policy), by copying the format, {{ 'text' | link_to: '' }}, and replacing text and the website. For example, {{ 'Privacy Policy' | link_to: '' }}

4. Press Save analytics settings

Public users will now see a similar banner when they visit your site:

All banners will default to the following look, however, you can use liquid variables to create a custom banner. 

Related HOWTOs

Did this answer your question?