'Wordpress Logged In Cookie and Google Tag Manager

I'm trying to set up GTM to avoid including any tracking JavaScript (GA, FB Pixel, Linkedin, etc) code for users logged in to the website. Only administrators can be logged in and the site is using WordPress so my theory is that simply checking that the WordPress logged-in cookie is set will allow me to add conditions to my triggers checking for the cookie.

The problem is that a 32-character hash is attached to the end of the cookie name. Something like this: wordpress_logged_in_c61670c29894a13760815de6f19b9544

How do I check for this in GTM?

I would like to avoid adding custom code to the website if possible. I know that adding a quick PHP function to set and remove a cookie would be quick and easy. I'd just like to see how it could be done in GTM.

In GTM I have a 1st Party Cookie called DL - WP Login Cookie. I'm just not sure what to place in the Cookie Name field since the cookie name is different for each user.

Can this be done?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source