Google Analytic Tracking for an entire server? - google-analytics

We currently use google accounts for our site ibiblio.org. Setting up the tracking on our landing pages is no big deal. But, we have tons of "collections" on our server, which as a public service, we allow a ton of users to host their own website installs (usually wordpress or wikis). Here is an example of a collection
These installs exist on a server, each install is a subfolder. Is there a way we can track the activity of these subfolders (or installs) without having to inject tracking code into each of their HTML files? We have a lot of contributors, so injecting code could get messy.
Thanks so much for your time and help.

There are ways, depending on the server's programming language, to create google analytics requests every page load (i.e. whenever page requests are fired). Tracking an entire site is not possible if the HTML files are served statically, because GA wouldn't know a page load happened.

Related

Google Site Kit Plugin has been copied to multiple sites, so Analytics information is inaccurate

My company manages several websites for clients. We build Wordpress sites and manage them all on Flywheel. Whenever we make a new website, we typically duplicate an existing site so that we can reuse some general settings. I recently found out that the Google Site Kit plugin has been getting duplicated, along with its existing settings, so that multiple separate websites have been pointing to the same google analytics account. Because they are all pointing to the same account, the Google Analytics account is just tracking slugs, thinking all traffic is coming from the same base url. Now all traffic on common pages, such as Home, Contact, and About are being clumped together, highly inflating the numbers of what traffic would be on any one of the sites. Is there a way to separate the data by base url, so I could see accurate data for each site?
In that case what you'll need to do on the sites with the same property is revisit the Site Kit settings and connect to the correct Google Analytics property (and Tag Manager / AdSense if applicable).
Note also that if your site URL changes Site Kit does recognize this, asking users to connect once more on the new domain. If you then connect on the new site you'll need to change the connected Google Analytics property.
Going forward, before you duplicate a site that has Site Kit active you can disconnect the Google Analytics, AdSense and Tag Manager modules before duplicating, before connecting once more after copying. Alternatively you can reset Site Kit before duplicating. Resetting will mean you'll need to connect all services once more (after duplicating).
Hopefully the above helps.

Wix template sending tracking via fileusr to my site - causing Google Analytics to view traffic as referral

My website is hosted on wix.com . Wix does not allow you to insert HTML code directly in the page of your web site. When I input HTML code, Wix inserts an iframe that is hosted from a different domain (filesusr.com). This iframe does not use Google Analytics tracking, so when the browser loads this iframe GA believes my customer has "left" my web site and gone somewhere else. When the iframe loads, the original source of the traffic is lost.
From the research I've done, it seems this Wix feature does not work with GA traffic tracking, and so there is no solution other than using a different hosting platform.
However, I'm sure you clever folk know otherwise!...
Right, Wix is notorious for being a "widget" based platform that does not play nice with custom code. However, the whole GA different-origin thing is such a common request that they implement the tracker directly themselves if you plug your GA ID into your site settings. Any reason you are not using this? - https://support.wix.com/en/article/adding-your-google-analytics-tracking-id-to-your-wix-site. They also claim to support other custom tracking snippets - make sure you are pasting it into the "Tracking & Analytics" section and not as a custom HTML widget.
If for some reason you can't or don't want to use the above methods, it used to be that you were just out of luck. There is a reason why Wix is not as favored as other platforms by digital marketers that need to implement tracking code. However, if you were really determined, you could probably implement a very custom GA tracker or any custom code through their new feature called Corvid, which exposes internal APIs and extra coding features. How to do so is beyond the scope of this question, but the postMessage() method is the normal way to pass messages from a parent to a child (iframe) container. Or you could use wix-fetch, which is an internal version of the web API fetch(), to manually send a hit request to GA.

Telling Google to index a new page, without using Webmaster Tools

I have a WordPress site that generates a single page site for users from some fields they enter into a form and some images they upload. I want to get Google to come out and index the page but my users will not be technical enough to set their page up with Webmaster Tools. What can I do from WordPress when I build the page to tell Google a new page is up and to please come out and index it when they have a chance?
Well you don't have to do anything actually, you could just sit back and wait for it to happen naturally. However there are things you could do to speed up the indexing process.
Here's a suggested way that does not involve having your users do anything:
Create one or more (quality) links pointing to their single page site from other websites that you know are already indexed in Google (see https://www.youtube.com/watch?v=4LsB19wTt0Q for more information). Ideally on blogs that get updated frequently because then then it is likely google crawls them more frequently.
Use a site:domain.com search in Google to see whether google has already found your new pages.
Here is how google crawling and indexing works:
Crawling:
Crawling is the process by which Googlebot discovers new and
updated pages to be added to the Google index.
We use a huge set of computers to fetch (or "crawl") billions of pages
on the web. The program that does the fetching is called Googlebot
(also known as a robot, bot, or spider). Googlebot uses an algorithmic
process: computer programs determine which sites to crawl, how often,
and how many pages to fetch from each site.
Google's crawl process begins with a list of web page URLs, generated
from previous crawl processes, and augmented with Sitemap data
provided by webmasters. As Googlebot visits each of these websites it
detects links on each page and adds them to its list of pages to
crawl. New sites, changes to existing sites, and dead links are noted
and used to update the Google index.
Google doesn't accept payment to crawl a site more frequently, and we
keep the search side of our business separate from our
revenue-generating AdWords service.
Indexing:
Googlebot processes each of the pages it crawls in order to
compile a massive index of all the words it sees and their location on
each page. In addition, we process information included in key content
tags and attributes, such as Title tags and ALT attributes. Googlebot
can process many, but not all, content types. For example, we cannot
process the content of some rich media files or dynamic pages
Source: https://support.google.com/webmasters/answer/70897?hl=en

How to know duration in site

I have a .net web site(eg: www.mysite,com) and I use some external links in my site that redirect to other sites (like www.google.com). But how I know a user spend time in second site(ie www.google.com)
Assuming you have no control over the external website - you cannot.
You cannot inject your own client-side scripting into external website (well, sometimes you can, but it's XSS and it's bad).
Google Analytics tracks the activity of the users on a certain website because website owner included javascript code.
It may be possible for Google to track user's activity over multiple websites but only if those website display Google Ads. It is not bullet-proof since users can block ads.

Google Analytics - only track traffic to a folder of the site

I want to track traffic for mysite.com/current-campaign/ and careless about traffic on mysite.com in general.
Is it ok to place the GA tracking code in the files inside the /current-campaign/ folder or does it HAVE TO be in the root of the server for tracking to work?
GA will only track on the pages you actually put the tracking code on, regardless of where the page is located (unless you start messing with things like domain settings or filters etc..).
So IOW yes, it is okay to do that. If you don't have tracking code on mysite.com/somePage.html then it's not gonna track that page (though it might show up as the URL in some reports like referring URL or exit link or whatever, same as any other page you don't track)
In Google Analytics, you can add a filter to the profile and filter all but the chosen directories. Go to Analytics Settings > Profile Settings and look for "Add Filter" link.
In addition to Crayon's answer, you can limit tracking to a subdirectory by using _setCookiePath() function in your tracking function. See Analytics documentation on single subdirectory (note the link anchor is not resolved to a correct header, at least for me).
This is advised in the documentation to use when you only want to track a subdirectory and avoid clashes with Analytics trackers possibly in use in other subdirectories.
I work for a department in a large university.
The department's web page resides at www.some-uni.com/department-name/.
I only have FTP access to the sub-folder /department-name/ and nothing else on the site.
It was quite easy to get Google Analytics to track traffic within the subfolder /department-name/, ignoring the rest of the site. All I did was create a profile in GA, setting the default url to www.some-uni.com/department-name/. I then pasted the tracking code into the pages I wished to track.
It took about eight hours for anything to show up in GA, but after that it worked just fine.

Resources