Hello, friends.
If you're going to put hours into creating content, you owe it to yourself to measure its performance and impact. You can use what you learn to determine where to spend the rest of your time. I recently updated the analytics backend on one of my sites. As I looked at the data, I saw some surprising things about several pieces of content that quickly changed where I plan to prioritize my efforts going forward. In this issue, you'll look at two metrics you can use to evaluate your content and how you can use them to predict future growth.
You'll also see how to rename multiple files with some Bash scripting.
Measuring your audience's engagement is crucial to understanding the impact of your content. Pageviews and unique visitors are two metrics that provide valuable insights into your content's performance. By understanding and measuring these metrics, you can make informed decisions about your content strategy.
Pageviews represent the total number of times any page on your site is loaded. They increase each time someone (or something) views a page, including repeat visits from the same user. If the same users repeatedly view the same content, this can inflate the perceived interest.
Unique visitors represent the number of individuals visiting your site over a period of time. Unique visitors are counted once per user, regardless of how often they visit your site. This provides a clearer picture of how many different people are engaging with your content.
Measuring both pageviews and unique visitors helps you answer important questions about your content's effectiveness. Pageviews tell you which pieces are getting attention, while unique visitors show how many different people are engaging with your content.
High pageview counts indicate popular content, showing what resonates with your audience. This can guide your future content creation, helping you focus on topics and formats that draw the most attention. But pageviews alone don't account for the number of individuals viewing your content. And if you only look at unique visitors, you could overlook the depth of engagement people have with your content.
High pageviews with low unique visitors can indicate that a few people are highly engaged. In contrast, high unique visitors with low pageviews suggest that your content reaches a broad audience but does not engage them deeply. Looking at these together, you can determine if you have some content that a group of users returns to repeatedly. You'll often see this pattern in documentation sites.
Pageviews provide a clear indicator of which pieces of content are attracting attention and can help you pinpoint the most engaging topics and formats. The unique visitors metric helps you gauge how effectively you are attracting new readers and maintaining a broad audience base. Measuring and understanding both metrics gives you a complete picture of your audience's behavior.
You can track pageviews by integrating tracking code into your site using web analytics tools like Google Analytics or Fullstory. These tools also track unique visitors by identifying individual users through cookies or IP addresses. Regularly monitoring this data will help you stay informed about your content's performance. You won't be able to collect data from every audience member, as they could block these tracking cookies. However, you can get pageview and unique visitor data from your web server's logs, as those have a larger picture of the data if configured correctly. You'll need server-side log analytics tooling for that.
To make the most of these metrics, you should regularly review and track your data over time to spot trends, set goals, and adjust your content strategy.
When you're starting out, use a spreadsheet to record your monthly pageviews and unique visitors for the entire site, with columns for the date, pageviews, and unique visitors:
Month | Pageviews | Unique Visitors |
---|---|---|
2024-03 | 500 | 200 |
2024-04 | 600 | 250 |
2024-05 | 700 | 300 |
Once you have this data, you can predict future growth by first calculating your month-over-month growth rate. Here's the formula:
For example, if your pageviews this month are 700 and last month they were 600, you'd have a 16% month-over-month growth rate:
You can then apply that growth rate to the current month's pageviews. In this example, a 16.67% growth rate would give you an estimate of 812 pageviews next month. This is a basic growth calculation; if you have a lot of fluctuation month-to-month, consider using a three-month rolling average instead of just the previous month. But when you're starting out, this method is a good way to set some goals for yourself.
You should avoid using percentages when you have small numbers and have to present your growth rates to stakeholders. A slight increase will show a large percentage change, even though there wasn't significant growth. Going from 10 to 20 unique visitors is a 100% increase, but only an additional 10 visitors. When you're working with small numbers, it's best to present the numbers themselves rather than the percentages.
You should track the data for the entire site, but you should also drill down and look at specific pieces of content. Try to identify the "best sellers." The best-performing content often has both high pageviews and high unique visitors, as this combination indicates that the content is not just popular among a few individuals; it's popular across the board.
Measuring both pageviews and unique visitors is essential for understanding your content's performance and impact. Pageviews help you identify popular content, while unique visitors reveal your actual audience size. By leveraging both metrics, tracking trends, and predicting growth, you can make informed decisions, refine your content strategy, and improve your engagement and reach.
There are additional things you should look at, including the amount of time people spend on each page. You may have content that gets a ton of traffic and visitors, but they leave immediately because they didn't find what they wanted. Analytics tools can also help you see this engagement rate, but that's a different topic.
You probably know you can rename a file using the mv
command:
$ mv file.txt newname.txt
If you need to mass-rename files, you can do so with a for
loop in Bash.
For example, to rename all files in the current directory with the .txt
extension to have the .md
extension instead, execute the following command:
$ for file in ./*.txt; do mv -v "${file}" "${file%.*}.md"; done
Within the mv
command, you use some variables and shell substitution:
${file}
is the variable that refers to the current file name. The file
variable is declared in the for
loop.%
indicates that you want to remove a suffix pattern from the end of the variable's value..*
is the pattern that matches the dot (.
) followed by any characters (*
), which represents the file extension in this case.${file%.*}
removes the .txt
extension from the file name."${file%.*}.md"
removes the .txt extension and appends .md
, creating the resulting file name.Using the mv
command with the -v
flag gives you a detailed output.
Running the command gives the following output:
renamed './chapter1.txt' -> './chapter1.md'
renamed './chapter2.txt' -> './chapter2.md'
renamed './chapter3.txt' -> './chapter3.md'
renamed './chapter4.txt' -> './chapter4.md'
There are other command-line tools that will let you do mass-renaming, but this is the method I've used for years because it doesn't require additional tools.
I've started adding small tips like this one to the new tips section of the Small, Sharp Software Tools site. You can find this one and several others there, and I'll add more over the next few months.
Now that you understand the difference between pageviews and unique visitors see if you can answer these questions:
As always, thanks for reading. See you next month.
I'd love to talk with you about this newsletter on Mastodon, Twitter, or LinkedIn. Let's connect!
Please support this newsletter and my work by encouraging others to subscribe or by buying a friend a copy of Exercises for Programmers, Small, Sharp Software Tools, or any of my other books.