All Collections
Organizer support
Domain Integration Guide
Domain Integration Guide

How to add the giveaway tracking code to your website

Valeriu Paloş avatar
Written by Valeriu Paloş
Updated over a week ago

To run giveaways on your domain, you need to load the TrustPrize Tracking Script in your website's source code. The script will render the opt-in pop-ups for your giveaways and will also confirm that you are, in fact, the true owner of your domain address.

  • We ask that your website is served on https:// and not on http://. This is a basic requirement that protects participants and their personal data.

  • This script must be installed at the root of your account's domain address but also on every sub-page where you want your giveaways to be shown!

  • When publishing a giveaway, we check your domain to ensure the script is installed correctly (at the root URL).

Here's what you need to do...

1. Install the script on your website

Place the following code in the <head>…</head> section of your website.

<script src="https://script.trustprize.com?account=ACCOUNT_ID" async></script>
  • Replace ACCOUNT_ID with your account's ID (at the top of the Company Profile page).

  • It's loaded asynchronously so it won't affect your website's loading process.

  • It doesn't use <iframe> and it doesn't conflict with your own CSS styles.

  • You can control when the pop-up is displayed from the campaign's settings.

2. Adjust your CSP rules

If you have Content Security Policy configured for your website, then - to make TrustPrize work with your website - append the following values to your existing CSP rules to allow required content from https://*.trustprize.com to be loaded properly.

script-src https://trustprize.com https://*.trustprize.com;
img-src https://trustprize.com https://*.trustprize.com;
font-src https://trustprize.com https://*.trustprize.com;
connect-src https://trustprize.com https://*.trustprize.com;
  • These values must be appended to your existing CSP rules.

  • If you don't use CSP on your website then you can ignore this step entirely.

3. Done.

To check the integration, go to your account's Tracking Script page and click the "Save and validate" button next to your domain address. You should get a "Domain validated successfully!" message upon success.

Did this answer your question?