Lesson #9: Add Google Analytics to Drupal Sites

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] the analytics section of SEO checklist covers installing the Google Analytics module and creating a Google Analytics account if you don't already have one now Google Analytics is a way for you to measure the traffic on your website and it provides a lot of information about the way people interact with your site mostly for instance how many hits your site gets how much time people spend on your site how much time they spend on certain pages gives you a lot of in-depth information like bounce rates pages that do particularly well pages where people leave after just a few seconds things like that none of this directly impacts your search engine optimization on its own unlike things like meta tags which can help you get a higher page rank what Google Analytics does is it gives you a lot of information to use so they you can see what's working on your site what's bringing in the most traffic and then strategize to capitalize on that the best you can so we're going to start off by installing and enabling the Google Analytics module you can find that at drupal.org slash project slash Google underscore analytics and once you've downloaded and installed the Google Analytics module as always we'll go to extend so now we can either search for Google Analytics here or click the statistics tab again if you're using the module filter module and we have Google Analytics it's just one single module we'll check it and install once this has been enabled we'll go back to configuration searching metadata SEO checklist and analytics and it should be checked off for us now wants us to configure Google Analytics now don't go here yet this is one place where I'm going to break from the order that the items are listed here and I'm going to say sign in to Google Analytics and create an analytics property for your website for now it's possible that you may already have a Google Analytics account and you may even already have Google Analytics on your Drupal website again if this is a site that you've already been working on that's already life technically you can use Google Analytics just by pasting in the tracking code into your template it's not a best practice at all it's always best to use the Google Analytics module but I have seen some people do that if they're not really 100% familiar with the best way to use Drupal so this is all to say we're going to do this step first you can sign in to Google Analytics at google.com/analytics to click sign-in analytics of course if you don't have an account don't simply ask you to sign up for one and you'll go through that process and then it's also if we go back to our checklist asking us not only to sign in but to create an analytics property for your website so going back to this page now if you've just set up Google Analytics for the first time then likely it's going to run you through the process of adding a property and by property it means website to your Google Analytics account in order to start tracking the traffic to that site because you can have one account with multiple websites now if you already have a Google Analytics account maybe you're using it to track traffic on other sites and you might get a page like this that goes ahead and shows you traffic for one of your sites the way you add another property is you click admin and under property you're going to click this button that has the name of the current site and then there will be a button to add a new property and then you'll have to go through the typical verification process and all that pretty simple stuff and you'll have that property added to your Google Analytics account so once we've done that we'll go ahead and check that off and click Save and then if we go back to analytics then we're going to configure Google Analytics now I'll show you why we're do this after this step in just a second so we can navigate to the Google Analytics module or we can just click configure here it'll take us straight there and the first thing we need to do is enter our web property ID Google Analytics gives you a unique ID for every property that you have and so we need to find the one for this site in our analytics dashboard and paste it in here as it says here it's always in the form of UA - lots of characters - two more characters it's very easy to find this information if you know where to look for it again this is in the admin section so you'll need to click admin if you haven't already make sure you have the correct property selected and then if you just click property settings you'll see the tracking ID right here and we have - just one character that's fine just whatever it shows here copy everything from the UA all the way to the very last digit and paste that in here and then we have a few other things to configure what are you tracking a single domain one domain with multiple subdomains such as WWE exsample com app example shopton example etc or multiple top-level domains for a multi-site setup in most cases in an our case we're going to be going with a single domain then pages you can add pages on here to leave off of your Google Analytics tracking so in other words we don't care about the traffic to admin or anything in the admin section this slash asterisk means admin slash anything it's leaving out these no dad that's where we're going to create new pieces of content on our website we don't want to track the traffic here because it's not indicative of real traffic that's coming to our site these are just admins that are logging into our sites in our case us to configure the site or to add content and that we don't care about that traffic because that's not real traffic so to speak so we're going to leave these pages off you can add any other pages here to leave also if you'd like or you can delete them all if for whatever reason you do want to track that traffic we can select what roles we want to track traffic for this is really useful just in the same way that the pages are useful here note if we have none selected it tracks everything we might not want to track administrators for instance so since this is add to these selected roles if we start narrowing things down here then we'll want to check the ones we do want to track unless we check this button add to every role except the selected ones just be careful with what you select here so if we're adding to these selected roles only and we don't want administrators to be tracked because again we don't care about their traffic that's not really real traffic we do want to track anonymous users and authenticated users now we also have the ability to track specific users behavior on the website we can give them the option to opt in or opt out and turn tracking on or off by default we can also use track user ID which as it says here enables the analysis of groups of sessions across devices for individual users if you want to know about the technicalities of that you can click here and Google will give you a little bit of information so really just choose whatever you feel is best for your analytics here I'm just going to leave them as they are cuz I'm not worried about drilling that deep down into it I just want an overall sense of my traffic but there are many cases in fact maybe most cases where you would want to track that links and downloads this is essentially saying that you're going to track links and downloads we're not going to do any customization here in most cases you'll just want to leave this as is it's a little bit more advanced messages you can track status warning and error messages that are shown to users now in all cases your users should not see these you don't want to be displaying for instance PHP errors or module errors or you know things like that system errors in general to your users that's not only bad user experience but it makes you look bad and it's a security concern but maybe just to be safe go ahead and check these so that way in Google Analytics you will be able to track warning and error messages especially if you don't think you're displaying them so that if some of these do show up then you can see that in your analytics dashboard and try to fix things accordingly search track and advertising you can track internal searches on your website now setting this up is also a little bit complex we're not going to dig into it but you can click this link for more information because this does take some configuration on Google Analytics site as well you can track Adsense ads if you are displaying Adsense ads on your website and track display features deals with using browser cookies to track user behavior across various web sites as they pertain to the ads that you're displaying as it mentions here if you choose this option you do need to update your privacy policy to let your users know that you're doing this I'm going to just leave all of these unchecked and finally you can anonymize visitors IP addresses this is typically a best practice so that you don't have any identifying information from your users as it mentions here in some countries it's illegal to track the full address if you do check this it will still be able to give you a lot of geographic information but it will as it says leave off the last octet of the IP address so you can't narrow it down to one individual or one location and then you're not going to have to worry about any of these other settings these are a bit more advanced and in most cases you won't need to touch them except for one thing that's in advanced settings which is locally cache the tracking code file now the way Google Analytics works is it puts tracking code on the pages of your website and when someone hits it that code executes and tells analytics to update the information accordingly say we got a hit right now this person is on the page for this amount of time again that's why that's done by pasting tracking code or by inserting tracking code onto the pages of your website caching that locally in other words caching it on your website instead of loading it from Google every single time a page is loaded can help your site performance-wise you're probably not going to notice unless you're running a very large site but there's not much of a downside the only downside is if Google Analytics updates their tracking code or in a way their tracking code works you won't get that update until like the next day so you just won't get it instantaneously that's really not ever going to cause you any big problems so I recommend locally caching this to help performance even if it's not really a visible boost in performance after you've done all that click Save configuration and now Google Analytics has been set up on our website and it will begin tracking our traffic now if we go back very quickly to searching metadata SEO checklist and analytics I want to tell it that we did configure Google Analytics we are caching Google Analytics code and we'll click Save and I'm not going to walk through this next step but the next step is to verify that your site is sitting data to Google Analytics that basically means visit your site click around on it and then check your analytics to see if any traffic was recorded now there are two things to note here one sometimes traffic is not instantly available so if you don't see that traffic show up right away then don't worry about it maybe give it an hour a couple hours or maybe even a day before you start freaking me out that is not tracking your traffic another thing to note here is that while you're doing this it's best to do this in incognito mode so in Google Chrome and Firefox as well if you right-click on it you can open an incognito window where nothing that you're doing is being tracked by your web browser what this also does is it has the benefit of essentially letting you visit the site as an anonymous user so it won't recognize you as coming from your usual place and you won't be logged in in any way so it's a good way to pretend that you're somebody other than yourself click around on your site so that way due to the configuration that we had in Google Analytics where we told it not to track admins not to track certain pages we won't accidentally be you know logged in as an administrator clicking around and for that reason it's not tracking our activity and then if we forgot about that and view analytics and saw no activity on there then we might freak out so when you're clicking around on your side to test this bottom line is it's best to do that in incognito mode to make sure that the traffic is actually being recorded again assuming that you have analytics set up properly so we'll check that when we're done the last things on here we see alt basically these are alternatives to most of what we've already done this is for piwik web analytics you can find out more about this at Toolik org there is a Drupal module for this service right here if we click download I'll open this in a new tab google.org slash project a slash pillock and all this is is an alternative to Google Analytics so if you prefer this over Google Analytics or for some reason you don't like Google Analytics then you can use pillock instead again it does the same thing generally speaking it's just another service that you can use instead of Google Analytics if you prefer
Info
Channel: OSTraining
Views: 7,839
Rating: 4.7777777 out of 5
Keywords: OSTraining
Id: 2wFXo-vnhWs
Channel Id: undefined
Length: 14min 39sec (879 seconds)
Published: Tue Jun 27 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.