Debaucus maybe malago could make a try
Flarum Ads for 1.0
[deleted]
malago I can wait as in last few days I learnt the concept of WLCR
The more you wait and learn, the more you'll get relaxing
@malago you revived my hopes on ads again, am following your post, Great work! You say google adsense ads are not showing properly? You will make the work easy if you could share a google adsense ad code here so we all troubleshoot since some of us have the knowledge but dont have adsense accounts, dont you think so?
Lets have the extension installed and adsense code and other ad codes, to try we complete this in few days!
Is there a way that I can adopt this to a specific site? Basically I have an image an an address that I want to point the user to when they click on it, I'll need to track how many view and click as well.
[deleted]
- Edited
Solution
https://countapi.xyz/
CountAPI is a free counting service, you can use it to track page hits, and custom events.
Here i made one for you : https://api.countapi.xyz/hit/ads-api-for-someone/visits
It will show 4 visits as I already used it 3 times and you will also go to this url so total 4, How many times you will hit it will increase visits....
[deleted] thank you this looks like a step in the right direction for me. I'm pretty new to web dev so can you please be a little more specific. Let's say for example I want to place an ads for "facebook.com" on my forum. I have a banner for the ads, and this api. How can I configure this extension to display a clickable ads that would direct the user to "facebook.com" and also track the number of click?
[deleted]
huuduy216 It is very easy copy the same and paste where you want don't forget to change huuduy-ads-counting to something unique.
<a onclick="userClickCount()" href="myMONEYlinkhaahha"><img src="https://discuss.flarum.org/assets/logo-9yg6hfqg.png"/></a>
<script>
function userClickCount() {
var xhr = new XMLHttpRequest();
xhr.open("GET", "https://api.countapi.xyz/hit/huuduy-ads-counting/fb-ad-img");
xhr.responseType = "json";
xhr.send();
}
</script>
Now if you want to see visits as an admin go to this URL,
https://api.countapi.xyz/info/huuduy-ads-counting/fb-ad-img
Please generate new name for your domain or any name, You can also use this but maybe users here will click the links and test and it may result in wrong results
To make a new one Change huuduy-ads-counting to something unique and don't tell anyone.
Braden Looking at source code, the old version of the plugin before @malago worked on it had this: https://github.com/malago86/flarum-ads/blob/main/js/src/forum/addAdsenseCompat.js
Unsure if it worked due to not using the previous versions.
Debaucus have you installed it yet? I had a different idea, if the html code can display in between the discussion, could we use a spoiler? e.g the flarum one by inserting [details title="Header Title"] ad message hidden text [/details]
and maybe it can be simple. What do you think about that? Can this way work?
- Edited
More or less cross-posting.
https://discuss.flarum.org/d/28031-fix-flarum-ads-extension
Discussion in a seperate thread is offering a possible bounty to resolve the Ad in relation to what I think is Google Adsense.
Why it's in a seperate thread I don't know.
Debaucus @matteocontrini have posted a solution, so need only to be implemented, we need to give some times to malago maybe
- Edited
matteocontrini This is excellent, thanks for sharing!
I made it work on my local installation but for some reason it is not loading the Google .js on my browser on the online version... I need one or two volunteers to try the dev version online!
composer require malago/flarum-ads:dev-main
Thanks
Actually I have no connection waiting a fix from my provider but sure when I’m back I will try
I have tried each types of ads ... but i feel that Display ads are working better.
Suggestion:
Ability to add Auto-Ad code the the Header for Google Adsense.
Debaucus there ianm extension for this