I hate Adsense, but I believe display ads are a necessity for modern web publishers who wish to monetize their work. Projects like Brave and Coil are working on unobtrusive monetization solutions, but they won’t be ready for mainstream adoption anytime soon. For now, I’ve chosen to stick with a small old fashioned HTML/CSS fixed display ad inspired by Daring Fireball, The Loop, and of course Carbon Ads. I didn’t see any tutorials on how to implement this kind of sponsor ad in WordPress without a plugin, so I decided to share my process in this post.
Yesterday, I spent the afternoon playing around with different ways to display the price of Bitcoin in Decrypto’s page header. After I got everything working, I realized forcing the price of Bitcoin on readers is a terrible and stress-inducing idea from a UX perspective. Regardless, here’s the PHP code I used to make it happen.
I was playing around with the latest Safari Technology Preview, which supports the new
prefers-color-scheme media query for detecting light and dark modes in MacOS Mojave. I ended up really liking the dark theme, so I decided to make it the default style for the time being. I’m still experimenting with colors, but I think this will be the general look.
@ me on Twitter if you hate it.
Recently, I was accused of editing past blog posts to fit my current perspective and narrative on a certain blockchain project. Considering this is my blog where I have 100% creative control over what gets published, I don’t think editing past content is necessarily an issue — especially when it’s an edit like the one below from a recent post on Substratum.
Update: As of September 1, 2018, I’ve been banned from the Substratum Telegram channel and subreddit for expressing an unapproved opinion.
Regardless, I decided to take this opportunity to figure out how to use blockchain to timestamp and archive blog posts. The idea here is to be able to point people to an HTML backup of a webpage on the blockchain to prove that I did not make any unreasonable edits since the “freeze date”.
If you’re like me, and spend a lot of time on your own blog, chances are you’re unknowingly skewing your Google Analytics data. This can often lead to exaggerated page views, among other things. Fortunately, there’s an easy way to filter out your own traffic from Google Analytics reports.
Finding Your Public IP Address
First, you’ll need to find your public IP address. To do this, just type “what is my IP address” into Google. For the purpose of this tutorial, I’ll be using 18.104.22.168 as my IP address.
Configuring Google Analytics
Next, click on the Admin tab in your Google Analytics dashboard. Navigate to the Account section of the page, and make sure the correct account is selected. Next, click on All Filters.
Now, click on +New Filter, and you should see a page that looks something like this.
Using Predefined Filters
If you’re just filtering out one IP address, using a predefined filter with the following settings is the easiest solution.
- Select filter type — Exclude
- Select source or destination — traffic from the IP addresses
- Select expression — that are equal to
- IP address — your public IP address (22.214.171.124 in my case)
Next, you’ll want to add all the the necessary available views to filter from. Since I use the same Google Analytics account for four of my websites, I have four instances of All Web Site Data under Available Views. I want my home IP address to be filtered for all my sites, so I have added all four of them to Selected Views. Next, click Save Changes. All done.
Using Custom Filters
If you want to exclude a range of IP addresses, you’ll have to use a custom filter instead. To do this, select Custom for the filter type instead of Predefined. Use the following configuration.
- Select filter type — Exclude
- Filter field — IP Address
Next, you need to type in a filter pattern for your IP range. Let’s say you want to filter 126.96.36.199 through 188.8.131.52. It’s not as simple as just typing 184.108.40.206–121. There’s a special syntax called regular expression (regex) you’ll have to follow.
For the IP range 220.127.116.11–121, the filter pattern would look like this.
Click here for a handy dandy regex generator.
Here’s what a completed IP range configuration should look like.
As with predefined filters, you’ll have to select the necessary web views to filter from. After that, click on Save Changes to complete the process.
If you’re serious about blogging, proper IP address filtering is crucial. Now, you can feel free to view your website as much as you want without affecting your Google Analytics data.