Best way to use Google Analytics in WB?

This section is for posting questions which are not directly related to WYSIWYG Web Builder.
Examples of off topics: web server configuration, hosting, programming related questions, third party scripts.

Note that these questions will generally not be answered by the administrators of this forum.
User avatar
etcbbu
 
 
Posts: 465
Joined: Mon Apr 23, 2007 3:00 pm

Best way to use Google Analytics in WB?

Post by etcbbu » Wed Apr 18, 2018 6:59 am

(the last few posts on this page will give you the best insight into what we were talking about in another topic on the wrong board : viewtopic.php?f=59&t=80288 )

But here is what I am trying to figure out right now:

So, what I have done in my .WBS file, in my WB project, just now is gone to the page of my website called

"masterpage1"

This page is set to NOT PUBLISH, but it is a "Master Object" that is called on every page of my website. So I now went to that Page, and, using the top-ribbon, I clicked

"Page" >> "Google Analytics" >>

I cleared out the line that says

"

Code: Select all

<!-- Insert Google Analytics code here -->
"

there, and simply pasted the Google Analytics code for my property, that I get when I log in to Google Analytics and click

"Options" >> "Tracking Info" >> "Tracking Code"

And literally just copy/pasted that entire snippet in place of the
"

Code: Select all

<!-- Insert Google Analytics code here -->
" mentioned above.

I then went to that same "masterpage1" and deleted-out the old way I was doing it, where I was using an HTML object to paste the Google Analytics snippet in an "HTML Object", on the page, in WB.

Then, I published my entire project, meaning, re-published every page of my website that calls the "masterpage1" page *which is set to not-publish* , but which also follows that method that @ColinM told me, which had me put the snippet into the Page >> Google Analytics location.

Am I to expect this is the best way to do this?

Because now, when I am in my .WBS file, and I now go to the individual pages of my website, and I use the top options

Page >> Google Analytics

Certainly, those all still say

"

Code: Select all

<!-- Insert Google Analytics code here -->
"

since I was thinking that @ColinM was saying that I only need to do it in the one spot, in the "masterpage1" Page >> Google Analytics spot?

Under this setting, when I visit my pages right now, I am not seeing myself show up as "Live Traffic", like I was, previously, whenever I was using an HTML Object on every page, to have the Google Analytics code.

Are my two options:

1) either now start publishing "masterpage1" Master Object, since it now has this Google Analytics Code in the Page >> Google Analytics location?

2) keep not-publishing "masterpage1" Master Object, but then go through and Manually paste-in the Google Analytics snippet one-by-one, page-by-page, doing the Page >> Google Analytics option for every page of the website?

Or is there something else I am missing?
www.ktravisj.com

Travis J Consulting, LLC -
Website Design/Development/Maintenance, Web-Marketing/Social Media/Social Networking, SEO/Search Engine Optimization

www.ktravisj.com

User avatar
Pablo
 
Posts: 17961
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Best way to use Google Analytics in WB?

Post by Pablo » Wed Apr 18, 2018 7:54 am

Master objects do not include Page HTML or Page Properties, only the object will be included.
If you want to add HTML code to a master page then you will need to use the HTML object.

User avatar
etcbbu
 
 
Posts: 465
Joined: Mon Apr 23, 2007 3:00 pm

Re: Best way to use Google Analytics in WB?

Post by etcbbu » Wed Apr 18, 2018 7:02 pm

ColinM was telling me, here:

http://wysiwygwebbuilder.com/forum/view ... 59&t=80288

That it's best to put the Google Analytics code snippet in "Head" of the masterpage that undergirds all pages of the website, and then publish the masterpage.

Whereas, I was more saying that I've never published my Master Objects in any of my projects that serve as my masterpages that comprise my headers and footers and stuff like that, which are called on every page of my website projects, because I'd rather not publish extra php or .html pages on my web-space for SEO purposes. So I'm going to use this method of pasting the Google analytics code, page-by-page, on every project, in that "Head" area, one-by-one. Does this sound like an acceptable way to use Google Analytics in my WB projects? I would just like to know, for sure, moving forward, because I will probably roll this out to multiple projects, if so.
www.ktravisj.com

Travis J Consulting, LLC -
Website Design/Development/Maintenance, Web-Marketing/Social Media/Social Networking, SEO/Search Engine Optimization

www.ktravisj.com

User avatar
Pablo
 
Posts: 17961
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Best way to use Google Analytics in WB?

Post by Pablo » Wed Apr 18, 2018 7:36 pm

- you do not need to publish the master page.
- if you want to add the code to a master page then it should be in an HTML object, set to 'between head tags'

User avatar
etcbbu
 
 
Posts: 465
Joined: Mon Apr 23, 2007 3:00 pm

Re: Best way to use Google Analytics in WB?

Post by etcbbu » Wed Apr 18, 2018 7:44 pm

Ok, I see what you are saying there; so I can either

- go page-by-page and use the Page >> Google Analytics and paste the code snippet there

- continue to use the HTML object on a masterpage, but just make sure I edit the Properties of the HTML Object, and edit the Type to be set to "Between <head></head> tags"

And those are kind of the two different ways it can be done in WB?
www.ktravisj.com

Travis J Consulting, LLC -
Website Design/Development/Maintenance, Web-Marketing/Social Media/Social Networking, SEO/Search Engine Optimization

www.ktravisj.com

User avatar
Pablo
 
Posts: 17961
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Best way to use Google Analytics in WB?

Post by Pablo » Wed Apr 18, 2018 8:18 pm

Correct

User avatar
ColinM
 
 
Posts: 469
Joined: Wed Feb 09, 2011 3:40 am
Location: Western Australia
Contact:

Re: Best way to use Google Analytics in WB?

Post by ColinM » Thu Apr 19, 2018 7:51 am

Pablo wrote:
Wed Apr 18, 2018 7:36 pm
- you do not need to publish the master page.
- if you want to add the code to a master page then it should be in an HTML object, set to 'between head tags'
Thank you Pablo for the correction - apologies etchbu 8)
Yours truly
Colin M
Western Australia
My Website

User avatar
tommy888
 
 
Posts: 388
Joined: Mon Sep 28, 2009 5:41 pm
Location: Poland
Contact:

Re: Best way to use Google Analytics in WB?

Post by tommy888 » Thu Apr 19, 2018 9:22 am

There's no need to add Google tracking code to master pages as well as publishing them as Pablo said.
Add the code to each page you want to have tracked by Google Analytics bots in <head></head> section. To make them indexable use robots.txt file or WB12 page settings. Robots.txt is preferred by Google.

User avatar
protectourlands
 
 
Posts: 449
Joined: Sat May 24, 2008 2:16 am
Contact:

Re: Best way to use Google Analytics in WB?

Post by protectourlands » Fri Apr 20, 2018 1:58 pm

You can also use the built in Google Analytics tool under the Page tab.

I prefer to use the Site HTML tool also under the Page tab. This way yo can apply the snippet to all pages in one step instead of having to insert it page by page.

ae_registration
 
 
Posts: 11
Joined: Wed Feb 01, 2017 8:24 am

Re: Best way to use Google Analytics in WB?

Post by ae_registration » Sun Feb 24, 2019 9:09 am

Does it apply to the project with unpublished master frame page used on every page of the site? I've tried to insert snippet into Meta Tags, html properties between <body> on every page, even only on master frame page. But didn't get GA working. It continues to show 0 online. Is there exist an exact manual for usual html pages using master frame objects? Thank you.

User avatar
Pablo
 
Posts: 17961
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Best way to use Google Analytics in WB?

Post by Pablo » Sun Feb 24, 2019 10:19 am

If you added the code to the master frame then you will need to republish all pages that use the master frame.

ae_registration
 
 
Posts: 11
Joined: Wed Feb 01, 2017 8:24 am

Re: Best way to use Google Analytics in WB?

Post by ae_registration » Sun Feb 24, 2019 10:39 am

Yes, the sequencing was the following:
1. I've created google analytics account
2. Got my tracking code.
3. Inserted it to the html code of the master frame using Google Analytics property
4. Then save the project and republished it (entire site and Publish html files only options)
5. After that I see 0 activity on the GA page, but there are a few users used this site.

Also I've tried to manually add code in some pages (between head option), tried to add meta tags option of the site... Nothing helps. Option "Generate external JS file..." is off. What else could be wrong?

ae_registration
 
 
Posts: 11
Joined: Wed Feb 01, 2017 8:24 am

Re: Best way to use Google Analytics in WB?

Post by ae_registration » Sun Feb 24, 2019 11:07 am

One more thing. I've generated html output locally to see the code. The part of it is the following:

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

gtag('config', 'UA-135071129-1');
</script>

</head>

Are there no mistakes? Empty line after /script tag and between gtag()'s... Is it ok?
Also. GA says that this code must be put right after the <head> tag and WWB puts it before closing </head>. Is it ok?

User avatar
Pablo
 
Posts: 17961
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Best way to use Google Analytics in WB?

Post by Pablo » Sun Feb 24, 2019 11:17 am

The code seems to be correct.
What is the URL of the page, so I can see what you have done?

ae_registration
 
 
Posts: 11
Joined: Wed Feb 01, 2017 8:24 am

Re: Best way to use Google Analytics in WB?

Post by ae_registration » Sun Feb 24, 2019 11:27 am

https://*.com/
Last edited by ae_registration on Sun Feb 24, 2019 12:43 pm, edited 1 time in total.

Post Reply