Google Analytics - Multiple pages and single header - html

My webpage is compose from more "pages". For example:
www.webpage.com/home.php
www.webpage.com/registration.php
www.webpage.com/contacts.php
...etc
But all my pages have the same , because I include the same head in all of my pages.
My question so far:
1.) Is good to place the google analytics script in my head?
2.) If someone goes from www.webpage.com/home.php to www.webpage.com/registration.php it will count it as two visit of my page?
Thx

its okay to place google analytics script in your head. google analytics is java script and is run only after the page is loaded into your browser. So each page will be individually recognized.

Yes. Google actually recommends to put the code in the header
Paste your snippet (unaltered, in its entirety) into every web page
you want to track. Paste it immediately before the closing
tag.
One of the reasons is that GA has a report on page timings. The timer is started when the tracking code is loaded, so if you insert the code later in the page the timing reports might be off.
If you have the tracking code in all pages and GA can set cookies properly then the two calls to the pages will be tracked as two pageviews, but only one session/visit.

Related

How to crawl a website with pagination using google script?

I am writing a web scraper with google script and want to make my script run until the last page of a specific website automatically.
My script works well on: https://www.louvre.fr/conferences-et-colloques , but I'd like to make it works on every single pages without specify the number of pages manually. Is there a way to make my script click on the "next page" button and loop it?
Best,

How did gdprscript.js get into the header of my Weebly site?

When I view the source of my website, I am seeing this script inserted into my website. However I cannot find the template where it is being added.
This javascript html tag is inserted automatically by Weebly's backend server itself. It inserts it immediatly after the <head> element and before any items you have defined in your actual template file.
<script src="/gdpr/gdprscript.js?buildTime=1558379751&hasRemindMe=true&stealth=false"></script>
What does it do?
This code forces the display of the "This site uses cookies..." message that pops over the bottom part of the page. It also handles the user's selection.
Why is it inserted if my site does not use cookies?
It is inserted because Weebly itself forces your site to use cookies. It does this to enable its own collection of analytics on your homepage.
Does it slow down my site
Yes. Code like this should be inserted after the site content.
Can it be removed?
You may be able have this removed by contacting Weebly directly.

How to stop Google ads from slowing down my website?

I am using the Google Chrome profiler to run a speed audit on my site.
It is complaining about a file show_ads_impl.js
I am not 100% sure where that is coming from? I took out AdSense from my page and now just have the Google AdWords retargeting being set. But I added the async tag to that script.
This is the page I am working on: here
And here is the screenshot of the profiler's complaint:
Also, the profiler suggests to use
<link rel="preload">
But where do I add that?
If you're noticing that Google ads are slowing down your website, there are a few things you can do to help speed things up. First, make sure that you're using asynchronous loading for your ads. This means that the ads will load in the background while the rest of your website loads. You can also try using a cache plugin to cache your ads. This way, they'll be loaded from the cache instead of from the server every time a page is loaded. Finally, you can try using a content delivery network (CDN) to deliver your ads. A CDN can help to speed up the delivery of your ads by distributing them across multiple servers.
You would add the link rel... to the head section of the page. One trick I use is to load the page, then the scripts on the page. I'm not sure where you currently have the scripts linked in your markup, but try linking them down at the bottom, just above the Body closing tag. The whole page loads, then the ads load - same time total, but the user won't notice.
...
...
<script type='text/javascript' src='googlyads.com/ads.js'>
</body>

Google analytics for different .html files in the same domain

Let's say that my website is www.myWebsite.com.
I have set up google analytics in index.html file properly and I get all the statistics fine in my dashboard.
Now my website has also got other html files, in the folder: www.myWebsite.com/folder/file1.html and www.myWebsite.com/folder/file2.html.
I want to track these pages too, and get how many view each page has.
In order to do this, do I have to use the same scripting code from analytics that I got for www.myWebsite.com ? And should the dashboard appear each page's views separately? Or do I have to set up different code for these pages?
I hope that I explained my problem well. Thank you in advance :)
Yes, you need to include the Analytics tracking code into the source code on every page you wish to track. This means including it in index.html and file1.html etc.
You can find more info in the Google Analytics help page.
You have to include generated code in every page that you wish to track.

Google Sites Drawing Reload

Total noob here with almost zero understanding of Google Apps Script or coding in general.
I was looking for a way to force a reload of a google sites page. This (reload page google apps script) makes it look like that can't be done, so I want to try and reload just the google drawing embedded in the site if possible.
I tried to use a javascript iFrame reload:
window.setInterval("reloadIFrame();", 30000); function reloadIFrame() { document.frames["frameNameHere"].location.reload(); }
But I don't think google sites supports this our I got it wrong somewhere.
I can't figure out what the correct Apps Script would be to force the page to reload(pull from the server) the drawing in question. The code for the drawing looks like this:
img
src="https://www.google.com/chart?chc=sites&cht=d&chdp=sites&chl=%5B%5BGoogle+drawing'%3D20'f%5Cv'a%5C%3D0'10'%3D999'0'dim'%5Cbox1'b%5CF6F6F6'fC%5CF6F6F6'eC%5C0'sk'%5C%5B%2211.30.15%22'%5D'a%5CV%5C%3D12'f%5C%5DV%5Cta%5C%3D10'%3D0'%3D1000'%3D347'dim'%5C%3D10'%3D10'%3D1000'%3D347'vdim'%5Cbox1'b%5Cva%5CF6F6F6'fC%5CC8C8C8'eC%5C'a%5C%5Do%5CLauto'f%5C&sig=0bBZl8MyZOx5b3ykHuUS35Gb8iE"
data-origsrc="1mUFhZeas0mFl52FpqC_EgflRn6P3TixsOxMAXI-_Fgo"
data-type="sketchy"
data-props="align:left;borderTitle:11.30.15;height:350;objectTitle:11.30.15;showBorder:false;showBorderTitle:false;width:1000;wrap:false;" width="1000" height="350"
style="display:block;text-align:left;margin-right:auto;">
It's located in my google drive and I just used the google sites tools to embed it, I didn't code it. The drawing is edited constantly throughout the day and I need the changes to appear while viewing with out requiring a page refresh.
Can anyone help me with where and what code could be used to reload the drawing? Even better would be if I could set an interval (say every 5 minutes) for the refresh. Any help is appreciated.
Thanks
Probably you can create an XML gadget that reloads the Google Sites Page.
Try this one (found quickly)
http://www.k8oms.net/refresh