How do I add Google Code on every page before the </body> tag?

Hi, Ive been building a website in Rapidweaver6, all is going well but have run into a problem.

I have been asked by a SEO/Adwords/online marketing specialist, who is planning on using the Google Remarketing tool to market the website, to add some code to every page of the site, just before the tag.

How do I do this?

I know I can view the source, and can see the tag near the footer but can’t seem to edit it.
There does not seem to be a box in the Site Wide Code section for this either.
Dropping in an HTML stack doesn’t quite get it in the right place.
This is a bit more advanced than I have worked on before, but any advice would be very much appreciated.

Im working with Stacks in Brandon Lees very nice Phenom theme, if its any help.
The live site is here:



Top left under the spanner/wrench icon (Settings), you could try pasting it into ‘Head’

1 Like

Thanks MarkSealey
I did try that but it adds the code to the Head area… as it should… but the tag is down near the footer.

Im really in need of a solution asap. Any other ideas would be really appreciated.


Have you tried adding into the area normally reserved for analytics? In the Stats section?
(Edit and major disclaimer: I don’t know if this is a no-no or not, I just thought that Analytics gets placed in the same spot, but I could be wrong, and my wife say that I often am)

I am speaking out of turn here, but, rumour says there may be a body section in the RW7 release…

Thanks Jabostick. If I already have analytics code added will adding more code effect the results?

Do as @jabostick suggests!

In RW7 we’re introducing a new “Body” code area, which will add code just before the </body> tag :slight_smile:

Any code added to the analytics box will be converted over.

Hi @ben
Thanks for the reply.
When I add the code after to Google Analytics that are already there, I see in the Source code that a line has been added near the head tag saying the Google Analytics will be added here when published. Does this mean the Google Remarketing code will go there too and not just before the body tag as I need?

Also just noticed, is there a difference between /body and just body in the source code?

Adding the tracking code snippet before the closing body is possible, but not the best solution. For correct and accurate tracking you should embed it just before the closing head tag.

The reason ist simple: If you put the tracking code at the end of your HTML document not all page views will be recorded: Visitors who will visit your page for just a moment and will leave in the next moment will not be recorded if the code is before the closing body tag. Or visitors who are bounced, maybe because or page loading errors will not tracked when the tracking code is at the end of the HTML document.

If it is, what reason ever, necessary to write the code before the body tag, there is a solution: Open the package of the Phenom theme, open the index.html with a text editor and write the code just between the closing footer and body tag.

Confusing is the information by Google - it is inconsistent:

The English information is: “…For this reason, the snippet should be located just before the closing body tag for your web page.”

The German information: “Fügen Sie das unveränderte Snippet auf jeder Webseite, für die Daten erfasst werden sollen, unmittelbar vor dem schließenden Tag head ein.”