Monthly Archives: November 2018

GDPR & AdSense: How to Create a Cookie Consent Modal that Defers Ads from Loading

Here you can find the code to accompany my video on blocking AdSense scripts from loading until the user has given consent: Here’s the HTML code for the consent modal: <div id=”consentModal” class=”modal fade” tabindex=”-1″ role=”dialog” aria-hidden=”false” data-backdrop=”static” data-keyboard=”false”> <div class=”modal-dialog”> <div class=”modal-content”> <div class=”modal-body”> <h2 class=”text-center”>Trust and transparency is important to us.</h2> <p class=”text-justify”> […]

How to Strip URL Parameters Using Google Tag Manager

This is the blog post to accompany my video tutorial on how to Strip URL Parameters from Google Analytics Page Views using Google Tag Manager: The following code overrides the page location stripping myparam from the URL: function() { var path = {{Page Path}}, query = {{URL Query Parameters}}, queryOverride = query.replace(/&myparam(\=[^&]*)?(?=&|$)|^myparam(\=[^&]*)?(&|$)/, “”), cleanedPath = […]