|
Introduction
If you’re not already familiar with these free Google tools, here’s a quick breakdown.
Google Analytics: Measures stats about your website like visitors, time spent on site, what pages they looked at, where they’re from, etc.
Google Search Console (formerly known as Google Webmaster Tools): It allows you to monitor different aspects of your website like when it was last crawled, any indexing errors, security issues, etc.
Search Console also lets you manage some key aspects of how you appear in search results and manually submit sitemaps — I’ll cover all of this later on in this article.
But first, let’s get set up.
If you already have Google Analytics and Search Console, click here to skip ahead to Step 3: Create a content marketing strategy.
To set up Google Analytics, click here and sign in with your Google account.
This would be either your @gmail.com email address or your @mydomain.com email address if you use Google’s G Suite for Business service.
Once you’re in, you’ll see this screen. Click Sign Up.
Enter your website name, URL, and then click Get Tracking ID at the bottom of the page.
You’ll see a page like this. Don’t panic!
There are a few ways to install Google Analytics on your website.
If you’re using WordPress or another content management system that is asking you for your Google Analytics Tracking ID, then you just need the number at the very top. In my case, Eg. It’s UA-98505090-2.
The WordPress plugin Google Analytics by MonsterInsights is really easy to set up.
Just download it, upload the plugin to WordPress, activate it, and you’ll see this screen.
Press the blue “Authenticate” button and it walks you through the rest.
To set up the plugin, you need to have an Analytics profile already created, which we did in the previous step.
If you’re not using WordPress or want to add your Analytics code manually, here’s how to do that.
You need to put this code (in the red box) onto every single one of your website’s pages.
The easiest way to do this is to create one file with the code in it and then create a line of code on each of your website’s pages that pull in that file.
Piece of cake, right?
Don’t worry, here’s how to do that!
For this step, you need to be able to access your website files on your web hosting company’s server. This is commonly done via FTP.
Open up your FTP client (FileZilla is a great, free one) and login to your server. If you don’t have this information, you can create an FTP account in your web host’s cPanel, or just contact your web host to ask them for the information.
Your login information should look similar to this:
Once you’re connected, you’ll see a list of files and folders like this.
Open up a new text file (Notepad for Windows or TextEdit for Mac are fine for this). Make sure it’s set to Plain Text Only.
In TextEdit, you click on Format -> Make Plain Text to do that.
This is really important because word processors like Word can add formatting to the code that can mess up the coding on your site. When working with code, always use plain text.
Once you have your plain text document, paste the Google Analytics code. You’ll end up with this:
Save your file as analyticstracking.php. Make sure it has the .php extension on it and not .txt.
If your text editor saved it with the name “analyticstracking.php.txt” for some reason, just rename the file on your computer to “analyticstracking.php”.
Upload this file to your root directory via FTP (the first folder of your website).
You need to add one line of code for each page template you have. This “calls” the file we just made and ensures every page of your website that uses that template is tracked in Google Analytics.
To do that, download all your website PHP template files and edit them.
If you have one named header.php that loads on every page, you only need to do this once!
Download header.php.
Next, open up the downloaded file in your text editor.
Look for the </head> tag and the beginning of <body>, like this:
Insert one line of code right after the <body> tag.
Copy this code: <?php include_once(“analyticstracking.php”) ?>
And paste it here:
Save your header.php file, and reupload it to your website.
Done!
If you don’t have a header.php file, you need to repeat this process for each php page template you have on your website, like index.php, blog.php and so on.
If you use WordPress, you’re definitely at an advantage. All you need to do is install a plugin.
Okay, one more thing to set up and we’ll move on to Step 3.
Now that we have Analytics set up, it’s time to add our website to Google Search Console (formerly known as Google Webmaster Tools).
Click here to go to the Search Console. Log in with your Google account.
You’ll see this screen:
Type in your website URL.
You’ll then need to verify that you own that domain. There are a few ways to do this.
By default, it may show you a verification option through your web host.
Click on the dropdown to find your domain name provider.
If yours isn’t on the list, you can press Other (at the bottom).
Search Console then asks you to create a TXT record, which involves an edit to your domain configuration.
Is this a little over your head? Not to worry, I’ve got a much easier way!
If you still want to add a TXT record though, here’s how.
Click on Alternate Methods at the top.
There are two easy ways to verify your domain: with Google Analytics or via an HTML file upload.
I’ll cover both of them.
To verify with Google Analytics, just select it and click Verify.
Google will check your Analytics account to make sure you are who you say you are, and if you are, you’ll see a success message. Make sure you’re using the same Google account with Search Console that you do with Analytics.
The process is still pretty easy with the HTML file upload method.
Click to download the file to your computer in step 1, then open up your FTP program again. Upload Google’s HTML file to your root directory.
Next, visit the URL Google gave you to make sure the file is there. In my case, that’s https://neilpatel.com/googlefba739b2a6dd0306.html.
If you uploaded it correctly, you’ll see the filename in your browser window.
Go back to Search Console and click Verify at the bottom.
That’s it!
Make sure to leave the HTML file on your server. It ensures that your website will stay verified with Search Console.
There are two more really important things you need to do now:
Add both the sitename.com and sitename.com versions of your domain
Set a preferred domain
Why do you have to do that, you ask?
As Google explains, “If you see a message that your site is not indexed, it may be because it is indexed under a different domain. For example, if you receive a message that http://example.com is not indexed, make sure that you’ve also added http://www.example.com to your account (or vice versa), and check the data for that site.”
Adding the other version of your URL is easy – repeat the same process that I just explained. In the example above, I verified my neilpatel.com domain. So I would go into Search Console and do the exact same steps but use “sitename.com” instead.
Once you have both “yourdomain.com” and “www.yourdomain.com” added to Search Console, you need to set the preferred domain.
To do that, click on your website in Search Console.
At the top-right corner, click the gear icon and click Site Settings.
Select if you’d like your URLs displayed with the “www.” or without.
-
-
Thanks for sharing stories that matters, 1 pick for a great recommendation, really appreciated
Requires Login
Thanks for sharing stories that matters, 1 pick for a great recommendation