All posts by peterfessel

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 = […]

Google Dialogflow Chatbot & Realtime Database Tutorial: Read & Write Data

I published a tutorial video on how to read from and write to the Firebase Realtime Database using snapshots and transactions. This blog post contains the code examples from the video: Here is the index.js for the first step which is just reading from the database using a snapshot: const functions = require(‘firebase-functions’); const {WebhookClient} […]

Google Dialogflow Chatbot & Slack Tutorial: Trigger a Slack Notification from a Firebase Webhook

In this blog post I’m going to share the code from my video tutorial on how to trigger a Slack message from a Dialogflow chatbot: Here is the index.js: // See https://github.com/dialogflow/dialogflow-fulfillment-nodejs // for Dialogflow fulfillment library docs, samples, and to report issues ‘use strict’; const functions = require(‘firebase-functions’); const {WebhookClient} = require(‘dialogflow-fulfillment’); const requestLib = require(‘request’); […]

The Role of the Scrum Master

As part of my work at AND Digital I started taking on several Scrum master roles this year. It has been a journey of growth and I came to like it a lot. While most of the times I divided my time between developing and being the Scrum master, a couple of weeks ago I had the […]