This video will show you how to insert Google Analytic Code into your website using Adobe Dreamweaver CS4. The first thing you will want to do is sign up for a google analytics account and then follow the instructions there. After you do that your code will be presented to you. Copy the code, and then watch this video!
Google Analytics keeps track of visits to every page you install the code onto. You must install the code into every page of your website. If you are using a PHP website, or WordPress, then you can install the Google Analytics code into the header, or a similar. The code can also be installed into the footer.
How to Insert Google Analytics code into your website (Traditional Way)
-From Google
- Finding your personalized Google Analytics Tracking Code:
- The tracking code is profile-specific, which is why you can only access it via the Profile Settings page for a specific profile. Please read Where can I find my tracking code? for full instructions. Below is an example of what the code snippet will look like. You’ll need to update the “xxxx-x” in the sample below with your own Google Analytics account number found in your personalized Google Analytics Tracking Code.
[html]
<script type="text/javascript">// <![CDATA[
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src=’" + gaJsHost + "google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E"));
// ]]></script>
<script type="text/javascript">// <![CDATA[
try{
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._trackPageview();
} catch(err) {}
// ]]></script>
[/html]
- Implementing the code:
- Once you find the code snippet, copy and paste it into the bottom of your content, immediately before the tag of each page you are planning to track. If you use a common include or template, you can enter it there. To implement tracking code for secure pages (e.g. https://), please read How do I obtain tracking code for secure pages?
- Implementing the code for unique pages:
- For more information on how to implement the tracking code for data-driven pages or pages with frames, please follow the instructions from the relevant section in the Google Analytics Installation Guide.
- Troubleshooting:
- You should be finished once you install and save your tracking code for your pages. If you wait 24 hours and still don’t see any data, please read Why isn’t Google Analytics tracking my Website?
How to insert Google Analytics Code into your website (Dreamweaver CS4)