Tools & Tips, WordPress

Set up Google Analytics in WordPress using the Header and Footer Plugin

In this article I describe how to install Google Analytics on your WordPress website using the Header and Footer plugin.

There are many ways to install GA: you can use specific plugins and many of the SEO tools (like RankMath) do this for you too. While those approaches do make it easy for you the advantage of using this method is that it makes it easier to apply addition tools that require you to add tags to the header, such as the Facebook Pixel. In my view, if you do it just this one way it will be easier to manage.

Currently there are two ways of doing this – using the old Universal Analytics tag or the newer GA4 tag. This article assume that you have already created a tag and provides instructions on adding it to your website.

The process is the same whether it’s a GA4 or a UA tag, however there is one extra step required for UA tags in order to ensure the data you collect protects private information of visitors to your site, which is important for compliance with GDPR.

How to Set up Google Analytics Property on your WordPress Website using the Header and Footer Plugin

Time 10 minutes

  1. Create your Analytics Property

    The steps for creating an Analytics property are not included here and it is assumed that you have already completed this step.

  2. Find Your Global Site Tag JavaScript Code

    Open Google Analytics.
    If you have more than one account, select the Account you want to use and and the appropriate property.
    Click the Admin wheel (at the bottom of the left menu sidebar) and the select Setup Assistant.
    Click on Tag installation and select Web from the Data Streams list.
    Now you’ll see information about the tag to use on your website, including the Stream URL (your website address), the Stream Name (this will match the Property settings) and the Measurement ID.
    Scroll down to the Tagging Instructions section and select Global site tag (gtag.js) and copy the code.

  3. Copy the Tag Code into your Header and Footer Plugin

    Copy the gtag.js code to your clipboard.
    Go back to your WordPress website and select Tools and then Insert Headers and Footers.
    Paste the gtag.js code into the Scripts in Header section.

    That’s it!

The final step is to go over to Google Analytics at the same time as visiting your site in another open tab or browser window.

If you don’t see anything and you’re running a cache tool (such as LiteSpeed) on your website, go back into the WP backend and clear it. Then go back to GA and check.

Go to the Real Time view and you should see a dot on or around your location . This means that it’s working.

If you have a very busy site and can’t tell from the Real Time view (that’s where you want to be of course so, fantastic!) you can check using the SiteChecker Pro website’s Google Analytics Checker.

Just type (or paste) your URL into the field and click the blue arrow button. The result will be shown below.

Choosing a Method for adding your Google Analytics Code

Although I wrote about the Code Snippets approach I think this is by far the easiest method. It’s also much simpler (and cleaner) than using a dedicated plugin because it’s so flexible: you could use this for adding Hotjar trackers, Facebook Pixel, Tag Manager – you name it. It’s fast and pretty simple and while it might seem daunting because you’re handling “code” you’re only copying and pasting so there’s really not much that can go wrong.

If you like found this post helpful and want to support me, please click the button below!

What if you need help?

If you don’t like the idea of messing with code or feel daunted by the idea of doing this yourself, you can book my time for the Google Analytics Quick Fix. In this time I can check the Google Analytics setup on your website, make any updates, or implement a completely new tag. Book it now!

Tools & Tips, WordPress

Set up Google Analytics in WordPress using the Code Snippets Plugin

If you’re serious about your business you should be monitoring the traffic to your website. One of the most comprehensive tools for this is Google Analytics.

Currently there are two ways of doing this – using the old Universal Analytics tag or the newer GA4 tag. This article assume that you have already created a tag and provides instructions on adding it to your website.

The process is the same whether it’s a GA4 or a UA tag, however there is one extra step required for UA tags in order to ensure the data you collect protects private information of visitors to your site, which is important for compliance with GDPR.

How to Set up Google Analytics Property on your WordPress Website using Code Snippets

Time 10 minutes

  1. Create your Analytics Property

    The steps for creating an Analytics property are not included here and it is assumed that you have already completed this step.

  2. Install the Code Snippets Plugin

    Visit the Code Snippets page and click Download to download the plugin files: https://wordpress.org/plugins/code-snippets/
    Install the Code Snippets plugin.

  3. Create a New Snippet for your GA Property’s Tag

    Open the Snippets plugin.
    Click Add New.
    Give your new snippet a label. We’ve used “Update Header Code” as ours as this will be used a generic snippet for adding tracking codes – such as the Facebook Pixel or Google Tag Manager – to the header, not just GA.
    Paste the base code as shown above. You can copy and paste this from here.
    Select Run snippet everywhere.
    Save your snippet.

    This will be used to edit the functions.php file and will be used to insert the code into your site’s header.

  4. Find Your Global Site Tag JavaScript Code

    – Open Google Analytics. If you have more than one account, select the Account you want to use and and the appropriate property.
    – Click the Admin wheel (at the bottom of the left menu sidebar) and the select Setup Assistant.
    – Click on Tag installation and select Web from the Data Streams list.

    You’ll see information about the tag to use on your website, including the Stream URL (your website address), the Stream Name (this will match the Property settings) and the Measurement ID.

    – Scroll down to the Tagging Instructions section and select Global site tag (gtag.js) and copy the code.

  5. Copy the Tag Code into your Snippet

    – Copy the code in this tag to your clipboard.
    – Go back to your WordPress website and open the Snippets list.
    – Open the Header and Footer snippet that we created earlier.

  6. Update and Save the Snippet

    With the code snippet open, replace the line of code that says <!– your code goes here –> with the code copied from Google Analytics.
    – Apply any formatting.
    – Add a Description (for your reference only).
    – Add any tags. In this example we’re using “google analytics”.
    – Click Save Changes and Activate.

    That’s it!

The final step is to go over to Google Analytics at the same time as visiting your site in another open tab or browser window.

Go to the Real Time view and you should see a dot on or around your location . This means that it’s working.

If you have a very busy site and can’t tell from the Real Time view (that’s where you want to be of course so, fantastic!) you can check using the SiteChecker Pro website’s Google Analytics Checker.

Just type (or paste) your URL into the field and click the blue arrow button. The result will be shown below.

Use this Code in the Code Snippet

add_action( 'wp_head', function(){
    ?>
    <!-- your code goes here -->
    <?php
});

I no longer offer tech support, preferring to focus on websites, SEO, and branding. However, I still love writing! If you like this post and want to support me, please click the button below!

Tools & Tips

How to Easily Translate your Word and PDF Documents using Google Translate

Google Translate has it’s good and bad points: as translation tools go it’s not perfect but it is very convenient. One of the little-known features of Google Translate is that, in addition to translating web pages or blocks of text, it can also be used to translate your text and PDF documents.

To translate your documents:

  1. Open the Google Translate web page and click on Documents (this link takes you straight to the Documents tab.)
  1. Click the Browse your computer button and find the file you want to translate then click Open. Your document will appear as in the screenshot below.
  1. Click the Translate button – then wait. After a short time a new window containing the translated document will open. That’s it!

This is such a simple tool to use but how many of us know about it? You can use it for many standard text-based document formats, including Word (doc and docx), Open Office (odf), PDF, PowerPoint (ppt and pptx), Excel (xls and xlsx), Postscript (PS), and Rich Text Format (rtf), which should cover most bases.

Have you used Google Translate for your documents? How helpful was it? Are there other better tools out there that you would recommend. Share your thoughts in the comments below!

Tools & Tips, Computer Maintenance, Tutorials

Spring Clean Your System Series: Introduction

Spring is in the air – at last! With the increasing light, we naturally start to clear out all those dusty corners and give our homes and gardens a good tidy up, ready for the year ahead. But what about your technology?

If, like me, you use your computer for work and also have a number of other devices you use, such as a table or iPad, the chances are you have a lot of files to organise. Whether that’s photos, e-mail or documents, just like your regular paper-based filing pile, a lot of clutter can build up over time if you don’t stay on top of it. And that’s just the stuff you see.

Whenever we use technology lots of files are used behind the scenes and these also mount up over time; things like temp (temporary) files, cookies from websites we visit, and a legion of other one-time and short-time-use files. All this invisible clutter stays on your system and over time slows it down, which is why it’s worth removing it. And what better time than Spring, since that’s when we get busy tidying generally.

Now all you need is a few specialist (free) tools and the know-how. What better way to start the week than with decluttered and organised computer! To help you with this I’ve put together a series of posts that will take you through the various ways you can tidying up and also get organised.

What’s Covered

First we’ll look at ways to declutter all those invisible files using some free software designed just for that purpose.

Then we’ll look at decluttering our files and applications.

And finally, once we’ve cleaned up our act, we’ll make sure we’ve got everything backed up, either to The Cloud or to an external disk or drive.

While you’re waiting…

In the meantime, why not get out some screen wipes and give the screen and keyboard a good wipe down. And, if you have a desktop PC or a laptop with a visible vent, it’s a good idea to put the hoover up to the back of the fan vent and suck out the dust especially if you have pets. No, seriously. One of our computers was constantly overheating. When we took the back off to check that all was well with the heat-sink we found, to our surprise, an enormous ball of fluff had collected there. No wonder it wouldn’t work!

Taking that one step further, if you’re confident to open the case on a desktop machine – and can do so without invalidating any warranties – it’s well worth giving your computer’s insides a good freshen up. Just open it up and give all the dusty looking bits a blast of air from an air canister such as this one on Amazon*. No more fluff – and no more whirring fan.

Although the focus of this will be on Windows systems, many of the techniques and tips will also be relevant for Mac users. Where there are differences, I’ll provide separate info in later posts.

Credits: main image copyright iStock.com/valio84sl


Are you ready to Spring Clean Your System? Don’t want to miss out? Subscribe to the newsletter for latest news, updates, and tech tips.

If you need help with this or any other aspect of your home or business IT, contact me to arrange a free consultation.

PLEASE NOTE, that this post contains an affiliate link. If you buy something through one of those links you won’t pay a penny more but I will get a small commission.

Productivity Tools, Tools & Tips, Websites

SEO Tools: From Yoast to SEO Press

Since I first started working with WordPress I’ve been using the Yoast plugin for my SEO. It’s a great tool. I’ve been happy with it and have been happily recommending it to clients. But lately there’s been chatter in some groups where WordPress pros and others discuss their SEO tools of choice, and I’ve been hearing very good things about SEO Press. After reading many reviews to find out more, I’ve decided to give it a go.

As I type, I’m backing up my personal blog and will shortly be installing SEO Press. Once it’s installed I will then go through the configuration and setup procedure (if there is one) and then work on and publish my first post using it. According to the instructions I’ve read it’s simple to use and has some great features, such as tools to help with titles and metatags, the creation of XML and HTML sitemaps (the latter being somewhat overlooked these days but still very helpful), content analysis with unlimited keywords, and also making it easy to implement Schema – a form of metadata that is increasingly favoured by search engines, giving your content much greater visibility in searches.

There’s a comparison of the tool’s features on the SEO Press website. It sounds impressive, at least for a free plugin. As with anything the proof will be in the pudding. After using it for a while I’ll come back with a review – on usability and also whether it makes any discernible difference to my site’s SEO! Of course, there’s no plugin in the world that can actually boost your site’s SEO. Only good writing and constant review and improvement can do that! But what a good SEO plugin can do is guide you a little and make some of the technical side of SEO, such as adding Schema tags and maintaining your XML sitemaps, easier to manage. Wish me luck!


Do you need help with your website SEO or WordPress tools and plugins? If so, contact me to arrange a free consultation – no obligation.


Read more articles about WordPress

Tools & Tips, Troubleshooting, WordPress

Fun and Games with Mixed Content and SSL Errors

Thanks to Google everyone is now familiar with the secure site padlock in the browser address bar. It’s pretty easy to setup thanks to some great tools like Let’s Encrypt (that generates free SSL certificates) and (for WordPress) plugins Really Simple SSL. But it’s not always plain sailing! Sometimes, despite using these tools you get mixed content and SSL errors> There’s plenty of info online about how to find and fix these (again, using plugins) but this is how I was able to repair a site that had just one page layout that was showing as HTTPS in the address bar but still listed as Not Secure.


Finally! I’ve been trying to figure out why a client site, one with no SSL issues (until now) has been showing just one page of the blog as Not Secure. I Googled, backed up the site then tried changing the URL using Elementor Tools (using the http version of the address and changing it to https). Nothing found.

Then I went into the SQL database and ran query on the http version of the site. Nothing found. Hmmm…

Another check on the incredibly handy Why No Padlock site (which should have been my first port of call) and an old non-HTTPS URL, actually to a development copy that I hosted locally, was flagged up for one of the images used on the page.

Next step: check the source for the offending image file.

Next setback: no file with that name is listed in the source.

So back in the SQL database I ran a search on the path of the file and found that there were 107 instances of it in wp_postmeta and another 27 in wp_posts. It’s definitely there!

A quick URL find and replace later using this query and it’s all back to being padlocked and secured.

UPDATE wp_postmeta SET meta_value = replace(meta_value, 'OLD URL', 'NEW URL');

UPDATE wp_posts SET guid = replace(guid, 'OLD URL', 'NEW URL');

UPDATE wp_posts SET post_content = replace(post_content, 'OLD URL', 'NEW URL');

Done!

""
Tools & Tips

Your Website and GDPR: Privacy Policy and Consent Copy

In my previous post, Are You GDPR Ready?, I suggested seven steps you should take to get ready for GDPR. In this post I’ll address numbers two and three:
How to Publish a Privacy Policy on your site to gain your user’s consent and Implement an Opt-In policy.

Publish Your Privacy Policy

Step 1:  Write Your Privacy Policy

Yes, the first thing to do, if you don’t already have one, is to write the policy. The new regulations advise businesses to use ordinary language so the best way to do this is to write it yourself. Take a look at the one on this site and also take a look at others, ideally for businesses similar to your own. Assuming you’ve done your audit already, you should understand exactly what data you have, how and why you use it, and where and how it is stored. All of that information needs to go into your policy document.

Step 2: Publish the Privacy Policy

To publish this to your site, create a new page for your website or blog and copy the policy text there.

It’s good practice to make this easy to find, so add a link to it from your website’s menu or somewhere out of the way but not hidden, like the page footer.

Step 3: Share Your Privacy Policy with Visitors to Your Site

If you have a website built around one of the many CRM platforms – Joomla, WordPress, SquareSpace, or Wix – the developers are ahead of the game, and there are a number of plugins that will make your work easier.

This site, based on WordPress, uses the plugin called GDPR by TrewKnowledge. It’s easy to set up and requires linking to your privacy policy page and some text added for the cookie consent popups. It has a bunch of other advanced features that you can use, if you need to.

Search Google and you can easily find similar tools for the other platforms listed above. If you’re not sure what any of this means, ask your web developer for help but don’t ignore the issue! It’s a necessary step in ensuring your site (and therefore your business) is compliant.

If you’ve got a static website, the simplest way to do this is make your new privacy policy page the landing page for your site. That way you know anyone who visits your site will have read it. Create a link to your main site, hidden behind the policy page, and require them to click link text that makes it clear that by clicking on the link to accept the site they accept the policy.

The downside of this approach is that it’s fairly unsophisticated: anyone visiting the site again will again be taken to the same policy page and will be required to consent on each repeat visit.

Implement an Opt-In Policy

If you collect email addresses for a mailing list or use forms, you need to ensure that users opt-in to any use of or storage of their data.

Opt-In to Mailing Lists

Most mailing list forms require the user to enter their name and email address before clicking a button to submit the form. Make sure that your text explicitly states how this information will be used (e.g., “in order to send you the weekly newsletter”, or whatever) whether or not it will be shared with or used by third parties, and anything else relevant to the person signing up in order that they can consent to it. You then need to ensure that any emails that are sent to the list, including any welcome message, makes it clear how the person who has signed up unsubscribes. That’s pretty standard stuff these days, but it’s worth checking that you have your house in order.

Opt-In for Forms

For contact forms, you must add a check box alongside a statement requiring consent for the data you provide to be used and stored. It’s also worth putting a link to your privacy policy but that alone is not good enough: you need to spell it out to the user there and then, in order that they can consent. An example of this is to say: “By submitting this form you consent to [company name] using and storing my information in order to respond to my inquiry.”

As with anything, there is more you can do but for small business and organisations it’s unlikely they will be necessary.


Disclaimer: This information is intended as guidance only. It is not a substitute for legal advice and is based on personal research conducted by the of the author. Ensuring your business is GDPR compliant is the responsibility of your Data Controller. 

Now read part 3 in this series.

In the next post find out how to makes sure files you create and store, on your laptop or other device, are secure.


Image credit: iStock.com/oatawa

Do you need help? Contact me now to arrange a personalised tech support or training session.
A banner with the words Tool Tip! and the words "Use icons on your docs and website" written on a small blackboard.
Tools & Tips, Websites

Using Icons in Websites and Documents

If you’re building a website or working on a document and you want to use some icons, where do you find them? A well-placed and well-designed icon can really give your site and files a professional look and feel.

There are many places to find them but you can quickly search Bootstrap, Font Awesome and Google via the Icon Reference page on the W3S site. Other icon sets, along with Font Awesome, are available from this Bootsnipp page.

From here, as the URL suggests, you can search the main open-source font sets using keywords. Or you can select a particular font set, if you have a preference.

The instructions below are for using the icons on your website. I’ll describe how to use them in a document in another post.

Search for an icon to use.

Type a relevant word into the Search box and click Enter. Keep in mind that most labels have a US focus, so you should look for trash instead of bin. In the example below, I searched for “home”. Scroll down the page to see the available options.

Get the link text for your icon.

When you’ve found the icon you want to use, click on it. This opens up a window showing the code to use for the icon. Press Ctrl+C to copy the code then OK to close the window.

Paste the code into your file.

Because the code is HTML, you need to make sure you are working in a format that can read it. If you are working in a WordPress template file (.php) or an HTML file, then you can just paste it in. If you’re in a blog post or page you will need to make sure it is read as HTML. In Gutenberg, do this by choosing the Custom HTML block type, which is listed under Formatting. If you’re using the Classic Editor, you should change to the Text tab and paste it in position.

Add a link to the icon source to your website’s header file.

When a browser reads an icon file link, t needs to know where to get that information from, so you need to put the link information in your website. The best place to do this is somewhere that’s related on the every page. In most WordPress template, these links will be there by default. If you find that your icons aren’t showing, check the header file, and if it’s not there, paste it in.You can find all the links on the Links for Font Icons page of this site.

That’s it! Just upload the edited header file to your server and your icons will be displayed. Here’s how my home icon looks on this page, with the icon code inserted here –>

For reference, here’s a link to my page with the icon source links:
Links for Font Icons

Tools & Tips

How to Install New Fonts in Inkscape

I wrote a post a few months ago about using SkyFonts to install new fonts in Inkscape, a freeware graphic design package that is a great substitute for Adobe Illustrator and Corel Draw.

When a client was asked me about this, I directed them to my original post, only to discover that those instructions no longer work. Typical!

The question then, is how to solve this persistent issue with Inkscape when the SkyFonts (which I find has become unreliable and unstable) workaround doesn’t work?

The new solution involves nothing more complicated (on Windows) than installing them in the standard fonts directory (C:WindowsFonts) but it also seems that in some cases this also fails to work.

In my client’s case, it was because the fonts were not installed for all users.

This means when you have downloaded a font, instead of double-clicking then clicking Install you have to right-click and choose Install for all users instead.

Fine, but my client didn’t have this option!

If this is the situation you find yourself in, here are instructions for adding new fonts that will be read by Inkscape (and Gimp). If they work for you (or if they don’t!), drop a comment below.

Step 1: Download and unzip your new font files.

When you download a new font, it usually comes as a zip file. Download the zip files then extract all the files.

Step 2: Install the fonts.

2.1. Navigate to the folder containing the new font files. These will usually be in TTF format

2.2. Select all the files, then right-click and click Install.

If you see a shield icon next to the Install instruction you will be installing it as an administrator and the font will installed for all users by default.
If you do not see this option, try holding Shift when you right-click, the choose Install for all users. As above, you should then see the shield icon next to this instruction.

Finally, if this doesn’t work, move the fonts folder you created to somewhere on your C drive (I suggest C:Temp) and then repeat this step. This will remove the fonts from what may be a user-specific directory.

Step 3: Open Inkscape and use your new font!

If you had Inkscape open, close it, then launch it again. Your new fonts should be listed.

If you’ve not heard of this software before, it’s worth a look. You can download Inkscape from here and Gimp (like Photoshop but without the price tag) here.

I no longer offer tech support, preferring to focus on websites, SEO, and branding. However, I still love writing! If you like this post and want to support me, please click the button below!

Tools & Tips

Tutorials to Help You Use Your Computer

I’ve been gradually putting together a list of tutorials aimed at solving issues addressed by my customers. Now there are a few to choose from, this post will help you to find them more quickly and easily.