How to add Google tracking code in simple html page I need some code or examples. Or please provide some kind of proper tutorials i am new in this. Thanks for the help :)
- Does it have anything to do with the Google App Engine? support.google.com/analytics/answer/1008080?hl=enLipis– Lipis2014-04-08 10:20:14 +00:00Commented Apr 8, 2014 at 10:20
- NO i just want simple tracking code. ThanksQubaish Bhatti– Qubaish Bhatti2014-04-08 10:21:14 +00:00Commented Apr 8, 2014 at 10:21
- Then why did you add that tag?! It looks like you've been here for a while.. did you go through the tour page? stackoverflow.com/tourLipis– Lipis2014-04-08 10:22:39 +00:00Commented Apr 8, 2014 at 10:22
- OH well i removed the tag now thanks. :)Qubaish Bhatti– Qubaish Bhatti2014-04-08 10:24:37 +00:00Commented Apr 8, 2014 at 10:24
Add a comment |
3 Answers
You'll have to setup a google analytics account where you can get your custom tracking code like the on @Joshua Dance showed, insert that code in the <head> of every single page of your webiste. It takes about 24 hours for the data to start showing in google analytics so keep that in mind.
Comments
Go to GA.
Get your tracking code. Add it in the <head> of your html page on each page you want tracked.
<head> <title>This Is Your Title</title> <link rel="stylesheet" type="text/css" href="style.css"> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-158081909-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-YOURTRACKINGCODEHERE'); </script> </head>