In the examples below, we'll use a website powered by WordPress. If your website uses a different CMS, the steps remain relatively the same:

  • Convert all your <script> to work with Free Cookie Consent by adding 2 parameters: type="text/plain" and data-cookie-consent="tracking" (for example).
  • If you haven't already added the generated code for the Cookie Consent, edit your theme/website and add the generated code of the Cookie Consent in the footer section of all your webpages.

Steps:

  1. Go to your website. If you use WordPress, go to Appearance and click on Theme File Editor:

    TermsFeed WordPress: Dashboard - Appearance with Theme File Editor option highlighted

  2. In the Edit Themes section from Theme files on the right side, choose footer.php:

    TermsFeed WordPress: Theme File Editor - Theme File with footer.php option highlighted

  3. Scroll down up to the </body> or in all locations where your JS scripts have been added (usually header or footer).

    In our example here, we already have a Google Analytics tracking code added in the footer part of the website that's not converted to work with the Free Consent:

    TermsFeed WordPress: Theme File - footer.php - GA script highlighted

  4. Edit the 2 <script> tags from the Google Analytics code by typing: type="text/plain" and cookie-consent="tracking" to each script tag.

    This ensures that the tracking code will load based on the consent preference of the Cookie Consent (ie. automatically on page load or when the user provides consent):

    TermsFeed WordPress: Theme File - footer.php with GA script modified for Cookie Consent highlighted

  5. Click on the Update file.

    TermsFeed WordPress: Theme File - footer.php with GA script modified for Cookie Consent - Update file button highlighted

  6. Done! The Cookie Consent Notice Banner will be displayed on your website with the Google Analytics code integrated (ie. it will load based on the consent preference selected).