Where to Copy Google Tracking ID in a WordPress Website

Tracking IDs are extremely important to have on websites which use the Google Analytics analytics tool. Knowing where to put these codes can be a little tricky though. Most website owners will tell you to put them in the header of your website. But what if you’re using WordPress (or any kind of blogging platform)?

Where should you actually put these tracking IDs? Here are some alternatives – some are better than others but they all have their strengths.

Behind the Scenes

In case you’re curious, tracking IDs are stored in the _trackings file. This is a text file hidden in your WordPress installation folder. If you’d like to check what your current settings are, you can use this link to open the file in a text editor and have a look.

Since this is a file stored directly on your server, it is the perfect spot for you to edit and customize the contents to your needs. You can use a text editor such as Notepad++ to make some quick edits to fix typos and grammatical errors. Or, if you’re feeling especially adventurous, you could try out a different text editor and see how it handles formatting.

If there’s one thing WordPress is known for, it’s its incredible flexibility. Since you have complete control over the contents of this file, you could conceivably do almost anything you want with it. Perhaps you want to store a lot of unrelated tracking IDs in it so it ends up looking like a messy jumble of text. Or maybe you want to carefully organize them into logical groups so it looks like a flow chart. It’s your call.

Header

Placing tracking IDs in the header of your website is the most basic and, in many cases, the most convenient option. The reason behind this is that when a visitor comes to your site, they’ll see the header and naturally assume the rest of the site is going to look and behave similarly. In practice, this means your header should contain only essential information – namely, your website’s name, description, and sometimes even a logo.

The only downside to this solution is that if you want to target a specific segment of users, you’ll have to create separate headers for each group. If you want to target users based on their geographic location for example, you’ll have to create a separate header for people in the United States, Canada, and Japan. Otherwise, you’ll get uneven tracking stats which could be quite disconcerting. For example, if you’ve ever tried to analyze traffic to a certain product based on the country it came from, you might find that your assumption that the stats would reflect the global figures was mostly wrong – in fact, the stats might even under-represent the U.S. or Canadian figures.

An alternative to the header is the footer. Since the footer is attached to the end of the website, it can be a good place to store additional information such as social media links and copyright details. This is especially useful for larger websites with multiple sections or articles where you want to keep track of the copyright information for each piece.

Sidebar

Another common place for tracking IDs is the sidebar. This is a region of content on a website which is accessed via pull-down menus or icons (usually located at the top of a website).

Since these menus and icons are frequently visible to users, it is a good option for displaying a lot of information in a small space. Naturally, this means you can fit more content in there. If you want to keep track of what’s in the sidebar, you could create a separate group in your analytics account for this content so you can see what’s there without getting lost in the jumble of other stats.

The downside to using the sidebar is that if you want to target a certain group of users with a specific offer, you’ll have to ensure that they actually see it. Since the sidebars are usually at the top of a website and out of the site’s regular view, users may not notice the offer unless you specifically tell them about it. In some cases, the traffic generated from the sidebar can be considered “below-the-fold” content. This means the users never actually get to the point of the website’s content; they land on it, glance at the sidebar, and then leave – having learned nothing. In this case, the offer in the sidebar might as well not exist.

Content

Finally, we have the content area of your website. This is, generally, the part which users come back to time and time again. When a user lands on your site, they’ll generally be interested in what’s in here – it’s usually the meat of the website. Naturally, you don’t want to bombard users with a lot of text if it’s something they aren’t interested in, but in general, this is where you want to keep the bulk of your content. Naturally, this means you can fit more content in there. The downside to this is that if you want to target a specific group of users with an offer or request, you’ll have to ensure they actually see it. Since the content area is at the very heart of the website, users might not notice the offer unless you specifically tell them about it.

From a design standpoint, the content area is usually the most important part of the website. This is because it’s the only part of the site which the users will directly interact with. If you’re looking for a place to put a lot of text, the content area is usually the best option since it’s the biggest area of the site and, therefore, the most prominent spot for the user to see.

Aside

Along with the header, the footer, and the sidebar, you can use the aside section to create another group of content. These are basically areas on a website which don’t have a direct relation to the content below them but, instead, provide supplementary information. Aside sections are frequently used to provide additional information about a product or service which is described in the content above it. As an example, you could have a blog post about laptops followed by an aside section with a link to the best laptop for photographers. The advantage of this solution is that you don’t have to worry about your content directly below it being affected – when a user clicks on the link in the aside section, they’ll see the content about laptops but the layout and design of the page will be the same as if they’d gone to the blog post first and then clicked on the link.

The disadvantage to this solution is that you have to keep the content above and below it distinct. In some cases, this can be difficult if there’s a lot of text in between. For example, if you have three articles above an aside section, you might have to create a new section break in-between the third and fourth articles so the two sections are clearly separated from each other. This can be difficult and potentially confusing for users since, typically, they’ll expect the layout of the page to be the same regardless of where they scroll to on the site. Therefore, you must ensure the content below and above the aside section is distinct and organized so it doesn’t look like there’s something missing or out of place when scrolling through the site (like content being cut off because of a nonexistent section break).

If you have a lot of text above and below the aside section, you might also want to consider creating a new container above the fold – this simply means the content which is visible on the homepage or first page of a website. Naturally, this will depend on the size of your website’s content but, generally, a lot of text which is displayed above the fold will not be able to be scrolled through without the user taking a second to figure out what’s going on (since a lot of the text will be out of the typical eye-line).

In many cases, a combination of the above should be sufficient to keep track of all your Google Analytics tracking IDs. Remember, you can always create more groups if additional information is needed for certain offers or products (or if you just want to keep track of the various IDs for future reference).