#17 Hide Google Analytics for logged in users

Amy Marsh Is A Fashion Technologist In Training

Screen Shot

Another easy Sunday task, and this time it seriously helps you gain better data about your site!

 

Today we will be adding google analytics code, but with a difference. This google analytics code will only count users views if they are not logged into the blog, because we know you like to check up on your blog and make sure everything is how it should be but don’t don’t need to know that you have read your own blog and so for more accurate data adding in this section of code will help!

 

 

First what you need to do is make sure you have your own google analytics, you can set that up here.

Next add this section of code to your footer.php file just before the closing body tag (i.e </body>), this states that if the person viewing the site is the user is logged in make google analytics inactive else complete google analytics code. Add your google analytics code in the section which states ‘GOOGLE ANALYTICS CODE':

 

DAY 17 COMPLETE!

Leave a comment with any questions or to submit your progress and make sure to check out the blog tomorrow and see what has changed!

 

Stay Updated

If you enjoyed this post, subscribe to the Fashion Technologist for updates

What are you interested in?

Discover more:
email course
(blog)Random Banner Ad Featured Image
Screen Shot 2014-06-10 at 17.43.10
two ways to make your site more secure
(feat) theFEED Profiles- RooftopAntics.com
How to change the default media linking option in wordpress
Why I do not like blog posts being By Admin
how to create a wordpress plugin

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">