" Paste it into the HTML of www.mywebsite.com, right after the tag".
.
By this they mean the after first head tag in start of head, i saw example in their help section. i need to add script inside head.
Pocket add codes after and before head, so to place inside head I pasted code in my theme tpl and my site showed error, went offline. Then I enclosed script in literal in my theme tpl. Site Working fine. This is what i did.
My question is. Do i have pasted right code enclosing in literal? adsense executive will be able to find the code in my forum html? How can i test? I am not a programmer, do copy paste by reading in community. Do not want to miss approval chance. Please guide.
Reason of confusion is: 8 hour ago i received email that i my application is successfully reviewed and i should create my first ad i.e blank ad. But when i visited adsense to create my first ad it still showing application is under review. my-ads section is not clickable yet. So i fear if i placed the code right. Before contacting them i want to be sure about this.
it worked perfect. I have a related query. Is currently there any way of inserting scripts in post while writing. i want to insert ad scripts in my first posts/comments. or will coming version offer this ability.
Without ads in posts my ad-sense ctr is 0.7% only instead of normal 5% because most users are mobile, i use vanilla forum as community cum blog, mobile users from google search see only one ad above post inserted by pocket.
I want to reset my WordPress website for some bugs. If I reset the website from scratch, install the same theme and upload the same blog posts and categories as anew, will my website have AdSense approval? Or should I do anything else? Currently, only the google ads script code is given in the header and added the ads.txt file in the main directory. Will I need to set up the Google site kit first and then reset it? Or after the reset? AdSense is currently on and shows ads. Same domain. I just want to reset WordPress once and work in a fresh way. Please help.
Thanks for reaching out. Questions in relation to changing your website for the purpose of AdSense approval would be best answered by the product experts at the AdSense Help Center. We can only assist with Site Kit related queries here.
I can't believe how hard this is to find, but even in the Google developer docs I can't find it. I need to be able to dynamically, only with JavaScript insert adsense. I also looked on StackOverflow and some others have asked this but no response. Hopefully this will be a better explanation and will get some replies.
Basically, a user inserts my script, lets call it my.js (can't say what it is specifically at the moment.) my.js is loaded and in my.js some embedded media is displayed on their page then I need somehow to append the generated HTML from:
P.S. No libraries like jQuery, and I can't insert HTML onto the page unless it's through JavaScript and it has to be inserted into a specific i named (I'm using Sizzle for my JS library if that helps)
The simple technique used to asynchronously load the AdSense script proposed by other answers won't work because Google uses document.write() inside of the AdSense script. document.write() only works during page creation, and by the time the asynchronously loaded script executes, page creation will have already completed.
The example first caches the native document.write() function in a local variable. Then it overwrites document.write() and inside of it, it uses innerHTML to inject the HTML content that Google will send to document.write(). Once that's done, it restores the native document.write() function.
I already have adsense on my page but also inject new ads into placeholders in my blog article. Where I want an advert injecting I add a div with a class of 'adsense-inject' then I run this script when the doc is ready and I know the adsense script has already been loaded for the other adverts:-
Here is an updated implementation, this is useful if you need no manage the Ads using a common external javascript include, in my case I have a lot of static html files and it works well. It also offers a single point of management for my AdSense scripts.
According to this page, it is possible to generate script tags and populate their src fields on the fly - which is what @noiv suggests (my version here should be self-contained; no external html or js libraries required). Have you tried this out? It does not seem so difficult...
OK, this seems to work for me, but as always, if Google change their model, this may become deprecated and no longer work. It simply required stripping the standard code that Google supplies into its 3 constituent parts, which are...
The tag that contains the original definition provided by Google. This is what you will place into your DOM wherever you need it via your JS build code. I tend to simply insert it as a string using .innerHTML, but you could do a document.createElement and manually add all the attributes depending on your requirements. I personally find no discernible advantage to either way, so it boils down to taste IMHO.
This method works for me great where I can place the Google Ad tag mid list when building paginated results by looping through an AJAX JSON result set (for example) and then once the list has been built, I then make the Google JS call (3 above). AND it allows for me to rebuild a list and recall the Google Ad build (3 above) as many times as I want (e.g. next page or changing number per page).
Adsense was successfully implemented on this Jekyll blog only after a deep research on Adsense policies. It is indeed possible to have ads on subdomain but you should know what you are doing. Just placing Adsense ads will not work.
The first problem I faced was applying for Adsense using a subdomain. My subdomain blog.webjeda.com cannot be used to applying for Adsense. Google has this policy for a reason. May be you have good content on your subdomain but what if you have bad content in your domain which is non-compliant with Adsense policies. Say some adult content or content related to drugs?
I decided to place an ad on my domain. And just after a day, while I was browsing my blog blog.webjeda.com I saw ads showing up. It was showing blank spaces before approval. But after seeing the ads I was really happy that finally something happened!
Create 3 html files with different names inside _includes folder(you can place only 3 ads per page. But this is not a hard and fast rule). Copy paste the Adsense code(responsive) that you generated in Adsense. Here is a sample Adsense code for the file. Keeping the script tags inside a div tag is optional.
In some weeks the new data regulation for cookies will be applied by Google Adsense.
The problem: now it is no longer enough to have an information text and click in accept in our flarum site.
Now it has to be an external verification company that accepts everything. If you do not comply you will not be able to display ads on Flarum.
The only free solution: Use google adsense's own script that you can activate from their platform. I testing in my forum but nothing change. I don't see Adsense's acceptance of cookies working. I go directly to the forum.
Walys, it seems as if either you register your solution with them or you implement one of theirs. This would have to be done in a separate extension to make it work. But I am not an expert. I haven't heard anyone else talking about this here yet.
For me this is working perfect in other domains where I have some wordpress installations. Only active the script in Google adsense for the domain and in some minutes view in the page as popup. This, when activate my domain where I have Flarum not view any cookie message in the web.
Implementing this is very simple. You just need to have this HTML Head Items extension and place your Adsense code. Then in your AdSense account generate the message and activate it, it will automatically appear in your forum.
Google AdSense consent only gives you control over cookies from Google AdSense, but not from third parties such as Twitter, Facebook, analytics or Flarum itself. You will need to combine this with some cookie extensions.
Yes I know this, I have not installed "HTML Head Items" extension in flarum but I add the G. Adsense and Analytics code in custom header option in flarum admin panel and working well with automatic advertisements.
In my flarum index view source display correct the code. Not understand why no view the Google cookies consent when activate in my google panel. Not view any error in my console or in my google admin panel.
If I remember correctly, at least a few months ago, gtag.js was necessary for the GDPR message to display (which is somewhat ironic since you can't add AdSense through gtag...). Another option was the IMA SDK, but it's been quite some time since I tested that, and with constant changes, it's hard to keep track. Maybe @Oshvam can confirm if the message stops appearing once gtag.js is removed.
Btw, if you're interested in this topic, blomstra/flarum-ext-gdpr is currently in very active development and welcomes testing, though of course, you can wait for it to be merged into the core in the future.
Darkle THanks Darkle!
For this moment prefer not install more extension to implement this. As indicated in the previous answer, working well with Adsense automatic ads and Analytics and have paste the right code (for Ads ang GA4 label) in flarum via custom header option.
Oshvam Honestly, I would say it's quite stable, it's already being used on live sites. I started using it last Thursday in production on a setup with a bunch of extensions, and I haven't had any issues at all yet. I still need to check some edge cases regarding the extension's functionality and consider possible improvements, but it's going very well. If you try it and find it works for you as well, you can thank @GreXXL for their relentless testing efforts! ?
c80f0f1006