How can I run third-party scripts only if visitors agree?

If you want to use a third-party script on your website, especially for sharing visitor data, make sure you get consent first. We recommend using Consent Manager, which lets you show a consent pop-up and ensures that the script only works for visitors who agree.

Here’s a list of steps you should consider when you use third-party scripts on your website:

  1. Make a list of all the third-party scripts you use on your site. These may be scripts responsible for advertising, remarketing, customer contact or other tools you use.
  2. As you audit, you can use our cookie scanner. It checks all the cookies on your site – first-party and third-party.
    Cookie scanner in Piwik PRO
  3. Add all third-party scripts through Tag Manager. It lets you fire tags only for visitors who give their consent to a specific script purpose.
  4. Assign appropriate consent types to tags that run third-party scripts. You can access this setting in Menu > Tag Manager > TagsConsent type.
    Consent types in Piwik PRO
  5. Adjust your consent form messages to clearly say why consent is needed. You can do this by going to Menu > Consent Manager > Consent templatesConsent form.
    Consent form in Piwik PRO
  6. Set up a process for adding all scripts, including third-party ones, using Tag Manager. Make sure each script is assigned the correct consent type. This will keep everything organized and linked to the right consents.

Was this article helpful?

Technical support

If you still have any questions, visit our community.
There’s always someone happy to help!

Back to help center