Vince said:[quote]If you are not using the incectstyle include file then you just need to
add this code to the head section of your template so that it appears on all pages...
[font=Courier New]<script async src="https://www.googletagmanager.com/gtag/js?id=G-AAAAAAAAAA"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-AAAAAAAAAA');
</script>[/font=Courier New]
You will need to change both of those instances of G-AAAAAAAAAA with your own ID.[/quote]
Perhaps I can suggest a method to do ^^^ this easily.
(1) Create a file named "
[purple]googleanalytics.php[/purple]", copy/paste in that Google Analytics 4 code snippet, then upload to your website server.
(2) Open your Adobe Dreamweaver website template
.dwt file and, in the <head> section go Menu ... Insert ... Template ... Editable Region ... Name =
googleanalyticsand edit that template code entry like so:
[font=Courier New][green]<!-- TemplateBeginEditable name="googleanalytics" -->[/green]
[blue]<?php include_once ("[purple]
googleanalytics.php[/purple]") ?>[/blue]
[green]<!-- TemplateEndEditable -->[/green][/font=Courier New]
(3) Save changes to your template
.dwt file, which will then Update and insert that code into all website files based upon that template.
(4) Now, open each webpage which
you do not want that Google Analytics 4 code snippet inserted and
delete the <?php include_once> line so that editable region is empty, like:
[font=Courier New][green]<!-- TemplateBeginEditable name="googleanalytics" -->[/green]
[green]<!-- TemplateEndEditable -->[/green][/font=Courier New]
(5) Save each file you edited, and finally,
UPLOAD ALL edited files to your server.
=> SO NOW, if that Google Analytics 4 code snippet ever changes, you will only need to update the one "
[purple]googleanalytics.php[/purple]" file, not every damn page on your website

And if you administer a few different websites, use the same method and merely change the G-AAAAAAAAAA entries in "
[purple]googleanalytics.php[/purple]" accordingly.
Gary
[img]https://itzap.com.au/pics/logo/itzap-website-design-works-mini-logo.png[/img]