NodeBB - Getting ads working
-
@AOKP Waiting to see your solution. Thanks for sharing.
-
Here the solution:
- Open
/public/src/ajaxify.js
. Go to line 174 and make it look like this:
ajaxify.end = function(url, tpl_url) { function done() { if (--count === 0) { $(window).trigger('action:ajaxify.end', {url: url, tpl_url: tpl_url, title: ajaxify.data.title}); googletag.pubads().refresh(); } }
- Save it and then restart NodeBB.
- Open
-
You could likely do
<script> $(window).on('action:ajaxify.end', function(){ googletag.pubads().refresh(); }); </script>
In your custom header
-
It world be nice with a plugin for this. Like the Adsence plugin but for DFP
-
@Jenkler said in NodeBB - Getting ads working:
It world be nice with a plugin for this. Like the Adsence plugin but for DFP
I'm working on it as of today.
Well, as soon as I can figure out the hooks and how to load from github.
-
Nice, Adsence plugin works fine except for the reload issue. Missing a lot of views ;( Would be nice if we could solve this with DFP!
-
@Jenkler the reload issue cannot be resolved so easily due to a change in the ajaxify.js.
Nonetheless I see no issue why you don't want to use DFP. Sure we discussed this previously, but if it is about monetization everything is right for me as long as it gets the job done.
-
But if I use DFP with only adsence. Is the reloadad issue resolved? At the momemet there is no plain DFP plugin like the adsence plugin. Hack the code is not a good solution. Is it possible to make a plugin that fixes all the nessesary changes?
-
@Jenkler said in NodeBB - Getting ads working:
But if I use DFP with only adsence. Is the reloadad issue resolved? At the momemet there is no plain DFP plugin like the adsence plugin. Hack the code is not a good solution. Is it possible to make a plugin that fixes all the nessesary changes?
+1 on that
hacking the code is a headache for futures updates
a king of solution should be offered by plugin or working with @administrators on the core -
@exodo how is this hacking the code?
This solution is more update prove than anything else, only a major change in the ajaxify.js would make it stop.
Adding the code into the custom header is definitely faster and efficient than downloading a plugin. -
@AOKP said in NodeBB - Getting ads working:
@exodo how is this hacking the code?
This solution is more update prove than anything else, only a major change in the ajaxify.js would make it stop.
Adding the code into the custom header is definitely faster and efficient than downloading a plugin.I was talking about the first solutions with public/src edits
-
@AOKP said in NodeBB - Getting ads working:
@exodo how is this hacking the code?
This solution is more update prove than anything else, only a major change in the ajaxify.js would make it stop.
Adding the code into the custom header is definitely faster and efficient than downloading a plugin.So there is a good way without hack to add DFP (reloads when clicking around ie more views). For documentation sake, could you plz explain how i can get the same functions at the adsence-plugin with DFP without hacking the sourcecode. Custom header and widget are allowed
- Same add for all (responsive Adsencecode in a responsive DFP container)
- NO Hacking
- Ads in first post
- Ads in header
- Ads in footer
- Better solution than adsence with support for reload of adds when clicking around on the page. (Generats more views than the setup I have today)
If this is possible I would change in a heartbeat
-
Focus on this thread!
https://community.nodebb.org/topic/9638/nodebb-and-ads-a-never-ending-story-part-2