In this post I’m going to show you how to add google analytics tracking code to your wordpress website okay so let’s get started you can see this is my google analytics account and i already have added this website i’ll quickly go ahead and show you how you can add a website and then generate tracking code and then you can see i have this wordpress dashboard area so i’m already logged in to my wordpress admin area and i’m using generate press theme and doesn’t matter what theme you you are using.
Let’s get started so first thing first you need to go ahead and create your analytics account if you haven’t and then log into it and then click on admin at the left bottom here the gear icon and this is your accounts section this is your property and this is basically every property that you have added so here you will simply click create property property name it’s going to be very simple walk through so simply go ahead and type in property name select the everything and then about your business and that’s going to be it you will be landing on such thing here and you would be able to select by select your property your website if you have more than one just by clicking this down arrow so i already have selected it and you can now get the tracking info by clicking this tracking info button here and and you’re looking for tracking code.
Basically go ahead and click tracking code here this is going to load in just few seconds and here we have tracking code it and this is your website tracking that’s all go ahead and copy it and then come back to your wordpress admin area and here you have two options two ways basically many ways but these are very common ones to add analytics tracking code to your wordpress website so the first way you can simply go to your dashboard go to appear and then go to theme editor and here your default the the theme that is active is going to be pre-selected otherwise you can select your theme that you want to add this tracking code to and want to make it active and default theme now here you have to look for okay so what happens these analytics or tools will ask you to put this code in head part and practically people don’t do this because what happens when you put an analytics tools tracking code in head section of your website it may slow and it does slow down your website page load basically so people prefer putting this in the lower section of the page so it could be in the footer or somewhere in the body part so what i would suggest you go ahead and look for footer however you can put it in the header section so go ahead and look for header.php or theme header and put it in this head section basically between the head and closing tag so you can just put it here if you want to put this in the head section and then what you want to do you want to update the file and you’re done so that’s the first way however i would not suggest you put this in here in the header section in the head section or head tag i would suggest you to go ahead and look for footer.php and put your analytics codes somewhere before the body closing tags so somewhere here okay and this will make sure that your site is not being slowed down by this analytics tracking thing okay so you can see this has been updated so this is very direct approach to adding google analytics tracking code to your website but it is not very practical but let me tell you why because what happens people keep changing their themes okay and when you change the theme this needs to be moved to the newest theme that you’re going to activate so what you need to do basically you should use a plugin okay so what i’m gonna do i’m gonna delete it update the footer.php and then go ahead and look for uh going to look for new plugin right so go to plugin and then hit new plugin and then type google analytics however google has released a plugin that does everything for you but people don’t like it yeah site kit by google you see you see it’s installed by one million people so what you can do you can put everything in here but if it is going to slow down your site use specific plugin which are basically built for you see google analytics so this this is going to be good for speed page load and this is also you see this is also very good plug-in which is specifically built for google analytics so if you’re not going to use everything that google has to offer like analytics search console adsense and then they have a speed testing tool as well so if you’re not going to use everything it’s going to be very heavy plug-in so don’t use it but you can certainly try it so what i would go ahead and do i will use this one this is a very reliable plug-in this one one is also reliable plugin adds google nl to your website only doesn’t do anything and what it this one does automatically downloads okay update analytics js bypass ad blockers with stealth mode and ad tracking code so this one has few extra features and this is why people use it a lot of people don’t know they are just rushing to add the analytics code and there are a lot of things going there are a lot of thing that goes after installing analytics tools basically tracking code that you realize later after some time after kind of a year or so when you see that your website is being slow you’re not getting consistent data so this is why people use this such plugins so i will go ahead and install it this is very good plugin and it is it has few extra features that these plugins don’t offer so go ahead and activate it and this is the plugin so go to settings you can also go to settings from here okay and you will have to type in the tracking id which you can get from here this is the tracking and you can see here this is the id so go ahead and just copy it this is also here when you select the property so this is going to be like this oops what did i do okay so that’s the tracking id track logged in administrators no you don’t want to track logged in administrator these are the few extra features that you get always tracking snippet type default there are a few options here asynchronous is good okay and now minimize the ip address i don’t want to position is very important so i wanted to go ahead and put it in the footer section and then save it and you can see we have advanced options enable compatibility mode i don’t have any compat uh woocommerce thing which file to download so you want to download analytics js and this is going to be a folder in your uploads where analytics will be downloaded uh if you have any cdn you can use cookie expires every 30 days perfectly fine sample rate one so these are a few options which are going to be good for your website few extension that they this company has extensions safe mode plug-in handling experimental you want so this is going to be the the stable release of the plug-in if you want the latest one you can go with the experimental so you can use these features so basically extra features some advanced features i think they shouldn’t call it extension but that’s how they have all right so this is how you add plugins to your wordpress website sorry and add your tracking code so it could be any analytics tracking code majorly people use google analytics so that’s how it’s added to wordpress website that’s it for this video guys if you have any questions suggestion leave in the comment below and i will try to answer it asap thank you so much bye for now