![]() |
Where & how to insert Google AdSense Code
Can some kind person please explain how & where to insert the Google AdSense code for my website running vBulletin 4.2.3 please.
I've been racking my brain trying to figure this out for days & days...but I'm not really getting anywhere. - Google seems to say add the AdSense code to the header and/or footer files. But this seems to apply to html based websites. - I also seem to keep seeing that I need to edit the vBulletin "postbit_legacy" template. But not really 100% sure where to add the AdSense code without messing things up. Could really use some help, Thanks |
In admincp, there is an option for advertisements. Simply select where you want to display the ads and paste the code.
See https://www.vbulletin.com/docs/html/...rtising_ad_new for details |
Quote:
Thanks |
Clear cache under Maintenance and check again. Usually it appears after some time.
|
Ok...cleared cache. Will wait a bit and see if successful:)
Thanks |
1 Attachment(s)
Been about 30 minutes...unfortunately nothing has shown up yet (hopefully that's long enough).
Any other ideas/suggestions? Here's a screenshot of my ad settings...maybe something is setup incorrectly? - I blocked out some of the ad code...but you can see there's html ad code there (copied & pasted from advertiser). - I believe I have it setup so that everyone see's the ad's (all usergroups). Thanks |
None of the checkboxes are checked in the section at the bottom. Review those settings and check at least one, for example the user (does not) belong to usergroup setting.
|
Hey Dave...thanks for posting.
Do I really need to check at least one of the boxes in the lower half of the screen shot? In the upper area there's the "Active" setting...with choices of "Yes" or "No". I currently have "Yes" selected. Right below that it says "If active and no criteria are set, ad will display to all." I'm understanding this to mean that if nothing is selected in the lower half...that the ads will display to all. So I was thinking I didn't need to check any of the boxes in the lower half of the screenshot. Thanks |
Are you using a custom style? Maybe ad templates are disabled in that. Check the default template. Also, do you have ad block installed?
|
Ah good catch, yes in that case no checkboxes need to be set.
|
Quote:
|
You are not using an ad blocker that could cause it not to display?
Feel free to private message me your website URL so I can take a look to see if it's working or not. |
1 Attachment(s)
Quote:
Yes...I normally do have an ad blocker installed...but I have it uninstalled at the moment. And I'm also using a 2nd computer (with no ad blocker)...and I'm getting the same results. Also awesome question regarding a custom style. I do believe I'm using a custom style (not vBulletin 4 default). I went to "Styles & Templates"...then "Style Manager"...then scrolled to the settings for "Ads". Hopefully I'm in the correct area. Attached is a screenshot of the settings. Anything look unusual? Thanks |
From what I can see, you have Google Analytics properly inserted and 2 Google ad locations: below navbar and above footer.
However, the Google Ads script code is missing, which causes the ads not to display. The Google Ads actual script that loads Google Ads must be inserted in the headinclude template. (where you inserted the Google Analytics script) |
1 Attachment(s)
Quote:
As you can see...I do have the Google Ad script code entered in the Ad Manager area. Thanks |
Ok...I did a search in the "Search in Templates" area...and found the "headinclude" template.
Are you saying that the same Google AdSense code that was inserted in the "Ad Manager" area...also needs to be inserted in the "headinclude" template as well? If so...where do I insert it...without messing things up.;) Thanks |
Yes, that script is not showing up on your forum. Insert it into the headinclude template and see if it then works.
|
<u>Just to be 100% sure:
</u> - Does it matter where the code is inserted in the headinclude template? I don't want to mess things up. - Can this html code be inserted directly into the headinclude template...without any additional PHP code? - Is the Google AdSense code that I inserted into the Ad Manager needed in both places to work properly (Ad Manager and headinclude template areas)? Thanks |
No need to worry, even if things break you can easily restore it back to how it used to work.
Just insert the Google Ads script at the bottom of the headinclude template and don't do anything else. |
Ok...gonna give it a shot.:)
--------------- Added [DATE]1531424927[/DATE] at [TIME]1531424927[/TIME] --------------- Hey hey hey...it worked!!! Yeyyy! Thanks Super-Dave!:) --------------- Added [DATE]1531425015[/DATE] at [TIME]1531425015[/TIME] --------------- If I wanted to get more ads working on my site...what files do I need to insert the Google Adsense code into? For example: - footer - header - sub-forums - within threads - etc. Thanks --------------- Added [DATE]1531426204[/DATE] at [TIME]1531426204[/TIME] --------------- As an example of where else to place ads. If I click on "Add New Ad"...I get the "Ad Selector" window. There's a drop down menu at the center top...with selection choices of (Global, Thread, Forum, Board). If I wanted to get ads operating in these area's...do I need to add the Google AdSense code to different templates to get the ads working in these areas? Thanks --------------- Added [DATE]1531488833[/DATE] at [TIME]1531488833[/TIME] --------------- Hey all. Dave helped me with getting my AdSense ads working in the header area of my website (mostly the home page)...still no luck getting ads working in other positions and other areas. Would like to get adds working in the: - Footer - Right margin - Other positions too. Also would like to get adds working on other pages/areas of website subpages such as : - sub-forum groups - indivdual sub-forums - individual threads Also in the header, footer, and right margin areas. Thanks:) |
All times are GMT. The time now is 08:04 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|