Help adding code/tags to all pages of the forum

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
alitech
Registered User
Posts: 3
Joined: Tue Oct 15, 2019 1:10 pm

Help adding code/tags to all pages of the forum

Post by alitech » Tue Oct 15, 2019 1:14 pm

hi all

New here to please be nice. I have searched and seen a number of responses to similar questions but I have something specific.

I want to add google tag manager code on the website. There are 2 tags and the instructions are:

Tag 1 : Paste this code as high in the <head> of the page as possible:
Tag 2 : Additionally, paste this code immediately after the opening <body> tag:

I have a third party theme on my website and it feeds off prosilver.


-----

Also, I was hoping someone here would have some experience with google adsense that places ads automatically in different places on the site. Have you seen any success with that on your forums?

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21676
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: Help adding code/tags to all pages of the forum

Post by Mick » Tue Oct 15, 2019 1:49 pm

Somebody asked this the other day and there wasn’t much help viewtopic.php?t=2525951

If you can give us the two code snippets we may be able to tell you where to put them but my guess would be overall_header.html, search for the head and body tags and follow the instructions.

There’s an extension for ads here https://www.phpbb.com/customise/db/extension/ads/
"The more connected we get the more alone we become" - Kyle Broflovski

User avatar
Mannix_
Registered User
Posts: 567
Joined: Sun Oct 25, 2015 2:56 pm
Contact:

Re: Help adding code/tags to all pages of the forum

Post by Mannix_ » Tue Oct 15, 2019 2:01 pm

Both of those places can be found in overall_header.html file as Mick already suggested, if your style doesn't have that file just copy it from prosilver to your style and make your edits :)
-=-=-=-=-=-=-=-=-=-=-=-=-My Styles-=-=-=-=-=-=-=-=-=-=-=-=-
HexagonHexagonRebornCleanSilverProject Durango
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Want me to port a style to 3.2.x etc. contact me here or on twitter.

alitech
Registered User
Posts: 3
Joined: Tue Oct 15, 2019 1:10 pm

Re: Help adding code/tags to all pages of the forum

Post by alitech » Tue Oct 15, 2019 2:35 pm

Thank you for the replies.

I have done a few other searches now and there seems to be some people saying that these tags need to go in the overall_footer.

Im confused.

Wouldnt the header and footer files just deal with header and footers as opposed to the whole page?

One of the tags are for <head> and one for <body>

alitech
Registered User
Posts: 3
Joined: Tue Oct 15, 2019 1:10 pm

Re: Help adding code/tags to all pages of the forum

Post by alitech » Tue Oct 15, 2019 2:40 pm

hi Mannix

I have the ad manager extension but its not very useful for tagging header and body separately.

Here is what my tag manager in google tells me.
Attachments
tagmanager.png

User avatar
mrgoldy
Jr. Extension Validator
Posts: 1182
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: Help adding code/tags to all pages of the forum

Post by mrgoldy » Tue Oct 15, 2019 5:59 pm

The first code snippet is using Javascript, the second one is for when there is no Javascript available. So I would suggest adding them both.
I would also suggest adding them both to the overall_header.html, for three reasons.
1. Then you can do both edits in a single file, easier to maintain
2. It is recommended by the actual site, so it would probably be best
3. Looking quickly at the code and the script, it looks like it works best when it is executed as soon as possible.

Post Reply

Return to “phpBB Custom Coding”