How to add Google Analytics Tracking ID to GitHub Pages
How to add Google Analytics Tracking ID to GitHub Pages
Could be a simple question but I am full of doubts right now about adding Google Analytics Tracking ID to GitHub page.
I am using GitHub automatic page generator to create my GitHub page but It asks for "Google Analytics Tracking ID". I tried to sign up with Google Analytics but there on it asks for website Url.
Now what I am supposed to do ?
One more ques: can we add Google Analytics Tracking ID later on after GitHub Page has been created.
Answer by exexzian for How to add Google Analytics Tracking ID to GitHub Pages
Update: Added steps descriptions for others
Solved it:
had to include username.github.io
(link that I want to track) in Google Analytics website section.
you can check GitHub help page here
After that I was provided with an Tracker ID.
Note: You can easily change or add more websites on Google Analytics page from your Google Analytics admin panel.
Update 2: - Adding Google Analytics Tracking ID to Already created Github pages (As requested by @avi-aryan )
- Browse to your github pages branch - which would be something like -
( https://github.com/YourUserName/YourRepository/tree/gh-pages ) - Then edit
index.html
from listed files - Now in within
HEAD
tag ofindex.html
- paste your Google Analytics Tracking ID Script ( if have already signed up for Google analytics then you can browse it under admin and then tracking info tab )
Answer by omouse for How to add Google Analytics Tracking ID to GitHub Pages
To add Google Analytics tracking id to existing pages you don't need to add the tracking javascript code to the index.html
. You only have to modify params.json
in the root directory of the gh-pages
branch.
params.json
{ "name":"Datastream.github.com",
You will want to set the "google" field to whatever your Google Analytics id is (it starts with UA-)
Answer by caffinatedmonkey for How to add Google Analytics Tracking ID to GitHub Pages
You can add Google Analytics to a Jekyll site the same way you would any other site.
First, after setting up your Google Analytics account, navigate to the admin tab.
Next, under the accounts panel, on the left, click: Create New Account
.
In Google Analytics, an account represents a set of pages that you would like to track. Set up the website's account as desired.
After your account has been created you will be sent to a page which tells you your Tracking ID
and has a JavaScript snippet for you to put on the pages you would like to track. Simply put this snippet in all the pages you would like to track. Or, if you use a default layout put this snippet somewhere in it.
By the way, since you are hosting on GitHub Pages you don't need Google Analytics unless you want very detailed analytics. If all you care about is page views GitHub has this.
Answer by user4011964 for How to add Google Analytics Tracking ID to GitHub Pages
Is better to use GA-Beacon for that. GA-Beacon can track all your GitHub repo, even if the visited link is'nt a html document.
Please check: https://github.com/igrigorik/ga-beacon
Regards
Answer by Colin for How to add Google Analytics Tracking ID to GitHub Pages
For anyone interested, if you are using Jekyll with GitHub pages, I just wrote a post showing how to correctly add Google Analytics Tracking ID to Jekyll.
You will find your Universal Analytics tracking code under Admin > Property > Tracking Info > Tracking Code.
Create a new file called
analytics.html
in the_includes
folder found in your Jekyll website?s directory.Add Google Analytics Tracking ID code to
analytics.html
.Finally, open
_layouts/head.html
, and add{% include analytics.html %}
just before the endtag. Google recommends this placement to track all of the pages on your website correctly.
Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72
0 comments:
Post a Comment