Notfunny01
Forum Replies Created
-
Forum: Plugins
In reply to: [GDPR] php helper function not working?And so, for anyone interested, I found the best way to get the is_allowed_cookie( $cookie ) helper function to work for a third-party script was to embed it with <? , { ?>, and closing <?php } ?> tags/brackets.
This I put in the Child Theme’s header.php for enabling/disabling Google/Doubleclick Ads/ cookies:
<? if ( is_allowed_cookie( ‘DSID’ ) ) { ?>
<script async src=”https://securepubads.g.**********.***/tag/js/gpt.js”></script>
<script>
window.googletag = window.googletag || {cmd: []};
googletag.cmd.push(function() {
googletag.defineSlot(‘/2**********/**-300-250-Foot’, [[300, 250], ‘fluid’], ‘div-gpt-ad-1575242906284-0’).addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
<?php } ?>Except this did not work where you are trying to insert the function within an existing script, in which case it could cause syntax errors. So for example I did this to Enable/Disable Social Media Cookies/Sharing Buttons in Jetpack:
if (is_allowed_cookie( ‘fr’ ) ) { $sharing_markup = apply_filters( ‘jetpack_sharing_display_markup’, $sharing_content, $enabled );
}As said in the plugin guide, the cookies must be named and listed in the plugin’s user interface for any of this work, as with Consents.
Just in case anyone, like me, still needed to know!
Forum: Plugins
In reply to: [GDPR] php helper function not working?Hi,
I meant can anyone explain how to get the wrap code to work?
I thought the code is part of the plugin’s functionality to Enable/Disable Cookies.
Unfortunately. I can keep trying, but so far I cannot get the plugin to block cookies!
Thanks.
- This reply was modified 4 years, 6 months ago by Notfunny01.
Forum: Plugins
In reply to: [GDPR] CCPA SupportIt doesn’t work at all for cookie consent. At least not since I have used it!
I have been trying for days but the ‘is_allowed_cookie( $cookie )’ function just doesn’t seem to do anything!
Unfortunately, I’m not sure if this plugin is supported any more at all. Which
is a shame as I had hoped it would provide an easier-to-implement solution for cookie management and GDPR.Forum: Plugins
In reply to: [GDPR] How to stop data being tracked before user has accpetedCan I ask: Do we really have to put the code, as in the example of the _GA cookie, in the Functions.php or could it be added in the Header or elsewhere? I ask this because everytime there is a Theme Update, the Functions.php is going to be over-written isn’t it?
- This reply was modified 6 years, 2 months ago by Notfunny01.