-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setRequestNonPersonalizedAds #63
Comments
If you want to serve non-personalized ads to all users, the easiest way would be to use the DFP settings (https://support.google.com/dfp_premium/answer/7673898). By default, DFP will send personalized ads to non-European-Economic-Area users. We don't currently have a way to do |
Any idea what would be the best way to do this? I've tried:
Without any luck. Only managed to get it working once by enqueueing a custom version of jquery.dfp.js but that threw a lot of JS errors. |
I would write something like this: <script>
window.googletag.pubads().setRequestNonPersonalizedAds(1);
</script> And then wrap it in a PHP function, and add_action that function with priority 9 on But that doesn't affect already-fetched ads, and might not trigger before the JS in I haven't tried this yet, but what you could attempt is setting doubleclick-for-wp/dfw-init.php Lines 187 to 204 in d90fba3
And in the lazy-loader in jquery.dfw.js: doubleclick-for-wp/js/jquery.dfw.js Lines 32 to 39 in ac6a821
An ideal revision to this plugin would be to set a filter on doubleclick-for-wp/dfw-init.php Lines 159 to 166 in d90fba3
And then, once the filtered options are output via the script localization on the page as the global doubleclick-for-wp/dfw-init.php Lines 187 to 204 in d90fba3
Then as an example of how to use this, we'd need some docs about using In conclusion, you're right, you'd need to customize this plugin some, but here's the list:
Please, if you have any questions about this response, let me know. This response not very well-edited and may be missing some code. |
How about dequeueing the minified JS, enqueuing the non-minified JS and adding the setRequestNonPersonalizedAds(1) straight into the code (as a quick fix since i'm not making any progress). |
Yep, you could do that, and that does sound pretty easy. |
No luck! Any chance of making this an update for all of us EU based users of this plugin? |
We'll add it to the next milestone for this plugin, but I can't guarantee a release date for that fix. Can you upload your edited version of the non-minified JS, please? Seeing what didn't work may help us get an update out faster. |
I added:
Beneath:
On line 297. Ideal would be to have some kind of filter/hook that we can access, for example using our cookie consent script. |
Thanks for providing the edit. What cookie consent script are you using? |
It's a custom one based one, pretty straight forward. I've created a simple WordPress function that checks if consent is given. Ideal for showing/hiding ads. That's why a filter/hook would be awesome! |
Any progress in adding this? Thanks! |
@tienvooracht Progress is starting in #81 and would be merged in the next 24 hours. What sorts of documentation would be helpful to you in using the filter added here? https://github.com/INN/doubleclick-for-wp/pull/81/files#diff-d3aa22c88317ac877d6ef91e82d40c08R172 |
#81 is merged for 0.3. @tienvooracht please let us know if the filter |
How would i get the plugin to use non personalized ads? Thanks!
The text was updated successfully, but these errors were encountered: