Highlighted

how to impliment gtags in Dreamweaver CS6 version 12

Participant ,
Nov 28, 2018

Copy link to clipboard

Copied

Where does the gtag code go, just in the index or in each template

Are you using a header template (ie, a page that is included on every page for the top of your site)?  If you have a template that is included on every page, it only needs to go into the header template.

If you are NOT using a header template, then it goes on every page.

In both cases, the code goes immediately after the <head> tag.

HTH,

^ _ ^

Views

664

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

how to impliment gtags in Dreamweaver CS6 version 12

Participant ,
Nov 28, 2018

Copy link to clipboard

Copied

Where does the gtag code go, just in the index or in each template

Are you using a header template (ie, a page that is included on every page for the top of your site)?  If you have a template that is included on every page, it only needs to go into the header template.

If you are NOT using a header template, then it goes on every page.

In both cases, the code goes immediately after the <head> tag.

HTH,

^ _ ^

Views

665

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 28, 2018 0
LEGEND ,
Nov 28, 2018

Copy link to clipboard

Copied

Personally, I find tracking evil.  But..

According to https://developers.google.com/analytics/devguides/collection/gtagjs/, you place the code after the <head> tag.  If you are not using a header file, then it goes on every page.  If you are using a header file, then it goes just in the header.

HTH,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 28, 2018 0
Participant ,
Nov 28, 2018

Copy link to clipboard

Copied

hi, so are you saying it only needs to go in the header of the one index page? If so does that one tag do the whole site?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 28, 2018 0
LEGEND ,
Nov 28, 2018

Copy link to clipboard

Copied

Are you using a header template (ie, a page that is included on every page for the top of your site)?  If you have a template that is included on every page, it only needs to go into the header template.

If you are NOT using a header template, then it goes on every page.

In both cases, the code goes immediately after the <head> tag.

HTH,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 28, 2018 1
Adobe Community Professional ,
Nov 28, 2018

Copy link to clipboard

Copied

If you're asking about Google Analytics code, I prefer to delay scripts until the rest of the page has loaded.  I always put scripts at the bottom of my page just above the closing </body> tag.

If you use DW Templates, you would put your scripts  inside your .dwt file.  When Template is saved, the code will be populated to all your child pages by DW.

Another option is to put GA Tracking code in a server-side include file.  But since you're already using Templates, you probably don't need that.

Nancy O'Shea, ACP
Alt-Web Design & Publishing

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 28, 2018 0
Participant ,
Nov 28, 2018

Copy link to clipboard

Copied

ok, we are using several templates for each site but I put the tag info just above the /head in each template but the tag shows up on each live webpage above the logos

Google people told me to just put the code in but I think I need the < > in to make the code invisible.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 28, 2018 0
Participant ,
Nov 28, 2018

Copy link to clipboard

Copied

no, Im not talking about GA that is in the body for years now

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 28, 2018 0
LEGEND ,
Nov 28, 2018

Copy link to clipboard

Copied

If you refer to the link I provided, you would see that you are instructed to place the following after the <head> tag (replace GA_TRACKING_ID with your ID):

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>
<script>
  window
.dataLayer = window.dataLayer || [];
 
function gtag(){dataLayer.push(arguments);}
  gtag
('js', new Date());

  gtag
('config', 'GA_TRACKING_ID');
</script>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 28, 2018 1
Participant ,
Nov 28, 2018

Copy link to clipboard

Copied

Im using     gtag('config', 'AW-1071700000'); and was told by Google people it can go anywhere between the head and / head . accoprding to them I can still use the old GA code just for tracking peoples movement etc

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 28, 2018 0
Adobe Community Professional ,
Nov 28, 2018

Copy link to clipboard

Copied

justbobm202  wrote

ok, we are using several templates for each site but I put the tag info just above the /head in each template but the tag shows up on each live webpage above the logos


That usually means you have an error in somewhere in the <head> section of your page. Possibly multiple <head> tagsets, maybe a missing or duplicated ending </head> tag that's confusing the browser into placing the gtag code as content instead of an invisible <head> item.

Make sure your page validates at http://validator.w3.org/nu before adding the code and after.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 28, 2018 1
Participant ,
Nov 28, 2018

Copy link to clipboard

Copied

I kind of answered my own question above ...I think I need the < > in to make the code invisible.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 28, 2018 0
Adobe Community Professional ,
Nov 28, 2018

Copy link to clipboard

Copied

When you add gtag tracking to the head of a page, it needs to be within a set of <script></script> tags.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 28, 2018 0
Adobe Community Professional ,
Nov 28, 2018

Copy link to clipboard

Copied

The official answer from Google Developers (Add gtag.js to your site  |  Analytics for Web (gtag.js)  |  Google Developers)

Install the global tracking snippet

To install the global tracking snippet, copy the following code and paste it immediately after the <head> tag on every page of your site. Replace GA_TRACKING_ID with the tracking ID of the Google Analytics property to which you want to send data. You need only one global snippet per page.

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>
<script>
  window
.dataLayer = window.dataLayer || [];
 
function gtag(){dataLayer.push(arguments);}
  gtag
('js', new Date());

  gtag
('config', 'GA_TRACKING_ID');
</script>

This snippet loads the gtag.js library, establishes GA_TRACKING_ID as the default Google Analytics property ID, and sends a pageview hit to Google Analytics.

If you'd like an easier way to track any Google and other 3rd party Javascript plugin and tracking codes, I highly recommend using Google Tag Manager (https://tagmanager.google.com) along with both the Google Page Analytics (1) and Google Tag Assistant (2) Extensions for Chrome. All three together will make tagging and tracking much easier to handle.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 28, 2018 0