MonsterInsights is with over 12 million installations one of the best and most popular WordPress plugins for Google Analytics. To keep using this popular plugin, we will show you in this article how you can use Borlabs Cookie Script Blocker to block the cookies to get your consent. Let's get started.
Step 1: Add Script Blocker
From the Borlabs Cookie menu, click Script Blocker and then click Add New.
SPECIFY PAGE AND SEARCH PHRASE
To make the work easier, enter the words mi_version and __gaTracker in the Search phrases field and separate both words with a comma.
The setting can be found under Insights > Settings > Advanced. The Administrator role must be removed under Exclude These User Roles From Tracking.
After your page has been scanned and you have clicked Next, you must set an ID and Name for your Script Blocker.
For ID specify monster-insights and as name MonsterInsights. You can set the Status to ON.
Step 2: Create Cookie
It's nearly done. Click on Cookies in Borlabs Cookie and then on Add New in the Cookie Group Statistics.
Under Services, select Google Analytics and click Next.
Borlabs Cookie fills in all necessary data. Scroll down to Additional Settings and enter something in the Tracking ID field. This field is mandatory, but we don't need it.
Under Opt-in Code, insert the code (remove the existing code first) that you just copied from the For Cookies field in the Script Blocker.
If you have the same look as in the picture, you can click on Save all settings. Done.
MonsterInsights is now initially blocked and only if the visitor agrees to the cookie for Google Analytics, MonsterInsights is unblocked and tracking takes place.
You don't have MonsterInsights yet? Here you can buy MonsterInsights.1
MonsterInsights®is a registered trademark of MonsterInsights, LLC.