<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Blair McKee</title>
    <description>The latest articles on DEV Community by Blair McKee (@theblairwitch).</description>
    <link>https://dev.to/theblairwitch</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F65474%2Fdc732197-1452-4f3f-8a6d-94aa5561765a.png</url>
      <title>DEV Community: Blair McKee</title>
      <link>https://dev.to/theblairwitch</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/theblairwitch"/>
    <language>en</language>
    <item>
      <title>Generate Types for Your GraphQL Schemas in 5 Minutes</title>
      <dc:creator>Blair McKee</dc:creator>
      <pubDate>Wed, 06 Jul 2022 13:12:50 +0000</pubDate>
      <link>https://dev.to/theblairwitch/generate-types-for-your-graphql-schemas-in-5-minutes-5a16</link>
      <guid>https://dev.to/theblairwitch/generate-types-for-your-graphql-schemas-in-5-minutes-5a16</guid>
      <description>&lt;p&gt;I couldn't find one single article that actually included all the steps to do this, so here's the step-by-step guide I wish I had hours ago on how to generate TypeScript types for your Graphql schemas 🫠&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Separate your queries out from your components (optional, but nice)&lt;/li&gt;
&lt;li&gt;Appease Webpack and TypeScript&lt;/li&gt;
&lt;li&gt;Install some packages and plugins&lt;/li&gt;
&lt;li&gt;Codegen time!&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Context
&lt;/h3&gt;

&lt;p&gt;I'm building an app using &lt;a href="https://graphcms.com/"&gt;GraphCMS&lt;/a&gt; (super awesome, by the way) but the only gotcha is it doesn't offer a plugin to export your schema types. Since I can't function without TypeScript, that was a big problem the second I tried to write mutations or generate static pages using my schemas. &lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1
&lt;/h2&gt;

&lt;p&gt;Move your queries to a directory where only your queries will live. &lt;/p&gt;

&lt;p&gt;Why? &lt;a href="https://nalexn.github.io/separation-of-concerns/"&gt;Separation of concerns&lt;/a&gt;, you don't want to couple your business logic with your presentational components. Also, it'll make it easier to to write your codegen config file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;query Question {
    questions {
    prompt
    tags
    id
    answer {
        html
    }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure each query is stored in its own individual &lt;code&gt;.graphql&lt;/code&gt; file. &lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2
&lt;/h2&gt;

&lt;p&gt;If you're using Create React App or &lt;a href="https://nextjs.org/"&gt;NextJS&lt;/a&gt;, you won't be able to compile at this point because webpack has no idea what a &lt;code&gt;.graphql&lt;/code&gt; file is. &lt;/p&gt;

&lt;p&gt;I'm using Next so this will end up in my &lt;code&gt;next.config.js&lt;/code&gt; file, but if you're using CRA you'll want to follow &lt;a href="https://create-react-app.dev/docs/loading-graphql-files/"&gt;these directions&lt;/a&gt; so webpack can parse your query files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = {
  webpack: (config) =&amp;gt; {
    config.module.rules.push({
      test: /\.(graphql|gql)$/,
      exclude: /node_modules/,
      loader: 'graphql-tag/loader',
    });
    return config;
  },
  webpackDevMiddleware: (config) =&amp;gt; {
    return config;
  },
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By the way, I found these config steps in this awesome &lt;a href="https://dev.to/ivanms1/next-js-graphql-typescript-setup-5bog"&gt;NextJS + GraphQL + TypeScript setup&lt;/a&gt; article 👏🏼&lt;/p&gt;

&lt;p&gt;You'll also want to add types for these files so Typescript doesn't yell at you. Add this to your &lt;code&gt;graphql.d.ts&lt;/code&gt; file at the root of your app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;declare module '*.graphql' {
  import { DocumentNode } from 'graphql';
  const Schema: DocumentNode;

  export = Schema;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3
&lt;/h2&gt;

&lt;p&gt;Install a bunch of stuff. &lt;/p&gt;

&lt;p&gt;I'm using yarn so swap out &lt;code&gt;npm i&lt;/code&gt; for &lt;code&gt;yarn add&lt;/code&gt; if you haven't joined the yarn bandwagon, yet.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add graphql-tag
yarn add graphql
yarn add @graphql-codegen/cli
yarn add @graphql-codegen/typescript-operations
yarn add @graphql-codegen/typescript
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👆🏼 There's a lot of stuff here, so let's break it down. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;graphql-tag -&amp;gt; is our webpack loader&lt;/li&gt;
&lt;li&gt;graphql -&amp;gt; you probably installed this already, but this is going to be an essential package later for when you want to make queries&lt;/li&gt;
&lt;li&gt;@graphql-codegen/cli -&amp;gt; this is &lt;a href="https://www.graphql-code-generator.com/"&gt;an awesome CLI&lt;/a&gt; 
that helps you setup your codegen config&lt;/li&gt;
&lt;li&gt;the rest are plugins for the aforementioned CLI To get it to work with TypeScript&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 4
&lt;/h2&gt;

&lt;p&gt;Once you've run all those scripts, we can finally codegen our types! &lt;/p&gt;

&lt;p&gt;You can use the CLI to setup your config, but I prefer to do it &lt;a href="https://www.graphql-code-generator.com/"&gt;manually&lt;/a&gt; (it's also quicker, tbh. I tried 3 different codegen CLI's and this manual way the fastest and least error prone). &lt;/p&gt;

&lt;p&gt;Create a &lt;code&gt;codegen.yaml&lt;/code&gt; file at the root of your app and start plugging in the link to your API schema and directories for your queries.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;schema: 'http://my-graphql-api.com/graphql'
documents: './src/queries/*.graphql'
generates:
  graphql/generated.ts:
    plugins:
      - typescript
      - typescript-operations
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;documents&lt;/code&gt; value must be a folder where all your queries live and they must be stored inside files that end with &lt;code&gt;.graphql&lt;/code&gt;, &lt;code&gt;.ts&lt;/code&gt;, or &lt;code&gt;.tsx&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Last but not least, we'll add a script to our &lt;code&gt;package.json&lt;/code&gt; to run all this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"scripts": {
    "codegen": "graphql-codegen"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can run &lt;code&gt;yarn codegen&lt;/code&gt; and see your generated types! Happy coding, y'all ⚛&lt;/p&gt;

</description>
      <category>graphql</category>
      <category>graphcms</category>
      <category>typescript</category>
    </item>
    <item>
      <title>CSS Grid in IE11: It's Possible! And Not as Hard as You Think</title>
      <dc:creator>Blair McKee</dc:creator>
      <pubDate>Tue, 04 Feb 2020 13:56:38 +0000</pubDate>
      <link>https://dev.to/theblairwitch/css-grid-in-ie11-it-s-possible-and-not-as-hard-as-you-think-okp</link>
      <guid>https://dev.to/theblairwitch/css-grid-in-ie11-it-s-possible-and-not-as-hard-as-you-think-okp</guid>
      <description>&lt;p&gt;Yes, it's possible! But it's up to you to know what is supported and what isn't. I'll save you the research and give you everything I found on CSS Grid in IE11. &lt;/p&gt;

&lt;p&gt;If you look at &lt;a href="https://caniuse.com/#feat=css-grid"&gt;caniuse&lt;/a&gt;, IE11 has partial support for CSS grid. But what does that mean? Basically everything from &lt;a href="https://www.w3.org/TR/2011/WD-css3-grid-layout-20110407/"&gt;this version&lt;/a&gt; of grid is supported... aka: nothing you can rely on if you're used to &lt;a href="https://css-tricks.com/snippets/css/complete-guide-grid/"&gt;modern grid&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;You'll need a supported CSS preprocessor or prefixer to give you all the polyfills you need to enjoy the awesomeness of grid in legacy browsers. &lt;/p&gt;

&lt;h1&gt;
  
  
  TLDR;
&lt;/h1&gt;

&lt;p&gt;There is no solution that polyfills everything for you. You still need to know the limitations of grid in IE11 and know what manual polyfills you'll need to write if you want to use methods like &lt;code&gt;repeat()&lt;/code&gt; or props like &lt;code&gt;grid-gap&lt;/code&gt;. You'll also need to explicitly tell each grid item where it should live in the grid, ie: you'll need to add a class to every item and tell it where to start, end/span. (Yes, it's a real pain, but do you want grid in IE11 or not?)&lt;/p&gt;

&lt;h1&gt;
  
  
  What's Supported in IE11
&lt;/h1&gt;

&lt;p&gt;Good news! &lt;code&gt;repeat&lt;/code&gt; is supported! It's just syntactically different. Instead of &lt;code&gt;grid-template-columnds: repeat(6, 1fr 100px)&lt;/code&gt; you'll have to manually write out &lt;code&gt;-ms-grid-columns: (1fr 100px)[6]&lt;/code&gt; for IE11. &lt;/p&gt;

&lt;h1&gt;
  
  
  What Isn't
&lt;/h1&gt;

&lt;h2&gt;
  
  
  span
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;span&lt;/code&gt; as in &lt;code&gt;grid-column: span 1/-1&lt;/code&gt; is not supported. &lt;/p&gt;

&lt;h2&gt;
  
  
  Child positioning
&lt;/h2&gt;

&lt;p&gt;Grid item positioning. I mentioned this earlier, but it's important to reiterate so you're not pulling your hair out after following everything else I said. Grid items need to be explicitly "placed" in the grid. And, sadly, you can't select each child with &lt;code&gt;:first-child&lt;/code&gt; or &lt;code&gt;:last-child&lt;/code&gt; and so on. You have to create unique classes for each child and tell them where to start and end in your grid. &lt;/p&gt;

&lt;h2&gt;
  
  
  Know your IE11 wierdness
&lt;/h2&gt;

&lt;p&gt;Another thing to be aware of… by default &lt;code&gt;display: block&lt;/code&gt; behaves differently in IE11. Usually, if you have a parent container with content inside, the parent will by default be the size of the content. In IE11, the parent is by default the width of its respective parent. None of the articles I read mentioned this, which tells me they didn’t actually test in IE11. Or &lt;a href="https://www.w3.org/TR/2011/WD-css3-grid-layout-20110407/"&gt;read the specs&lt;/a&gt;. But I did for you, so you don’t have to.&lt;/p&gt;

&lt;h2&gt;
  
  
  grid-gap
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;grid-gap&lt;/code&gt;, too, which is hands down my favorite CSS grid feature, does not get IE11 support. But you get by if you make extra columns/rows to act as your gaps. &lt;/p&gt;

&lt;h2&gt;
  
  
  everything auto
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;grid-auto-rows&lt;/code&gt; and &lt;code&gt;grid-auto-columns&lt;/code&gt; are not supported, because IE11 can only create columns and rows automatically based on the size of the content it contains in the grid. So if you try to explicitly give a size with &lt;code&gt;auto&lt;/code&gt; rows or columns, it will default to auto. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;auto-fill&lt;/code&gt; and &lt;code&gt;auto-fit&lt;/code&gt; won't work either, because IE11 has no concept of auto placement. Although, there are ways to &lt;a href="https://css-tricks.com/css-grid-in-ie-faking-an-auto-placement-grid-with-gaps/"&gt;hack it&lt;/a&gt; with autoprefixer. &lt;/p&gt;

&lt;p&gt;But &lt;code&gt;minmax()&lt;/code&gt; will work! Just not with &lt;code&gt;auto-fill&lt;/code&gt; or &lt;code&gt;auto-fit&lt;/code&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  shorthand
&lt;/h2&gt;

&lt;p&gt;Shorthand props like &lt;code&gt;fit-content()&lt;/code&gt; and &lt;code&gt;grid&lt;/code&gt; won't work, but they will if you write them out longhand. &lt;/p&gt;

&lt;h2&gt;
  
  
  inline elements
&lt;/h2&gt;

&lt;p&gt;If any of your grid items are &lt;code&gt;inline&lt;/code&gt; elements, they won't respect the grid. AKA your &lt;code&gt;span&lt;/code&gt; and &lt;code&gt;a&lt;/code&gt; tags. But what most people don't realize is any new HTML5 elements won't be recognized by IE11 and it will see them as &lt;code&gt;span&lt;/code&gt;s and inline them. So you'll need to explicitly displaying them as &lt;code&gt;clock&lt;/code&gt;, such as &lt;code&gt;main&lt;/code&gt;, &lt;code&gt;header&lt;/code&gt;, &lt;code&gt;footer&lt;/code&gt;, etc. &lt;/p&gt;

&lt;p&gt;Thankfully, normalize CSS does this for you... but check with your compiler or preprocessor to make sure they do. &lt;/p&gt;

&lt;p&gt;This is just the tip of the iceberg, read &lt;a href="https://css-tricks.com/css-grid-in-ie-debunking-common-ie-grid-misconceptions/"&gt;CSS trick's article&lt;/a&gt; for even more of what's supported. &lt;/p&gt;

&lt;h1&gt;
  
  
  Put your preprocessor to work
&lt;/h1&gt;

&lt;p&gt;Not a fan of manually polyfilling your code? Cool, me too. Try these libraries out...&lt;/p&gt;

&lt;h2&gt;
  
  
  Autoprefixer
&lt;/h2&gt;

&lt;p&gt;Now there are a lot of great articles out there already that talk about this, and almost all of them end up with the same solution, use &lt;a href="https://github.com/postcss/autoprefixer"&gt;autoprefixer&lt;/a&gt; which seems to have polyfills for almost everything... &lt;/p&gt;

&lt;p&gt;Almost everything... but there are still some things you have to polyfill manually. &lt;/p&gt;

&lt;p&gt;If you are okay adding another dependency, there's a lot of &lt;a href="https://medium.com/@elad/supporting-css-grid-in-internet-explorer-b38669e75d66"&gt;content&lt;/a&gt; on &lt;a href="https://css-tricks.com/css-grid-in-ie-css-grid-and-the-new-autoprefixer/"&gt;autoprefixer&lt;/a&gt;, which does seem to be the tried and true solution (for almost everything). &lt;/p&gt;

&lt;p&gt;But... I try to avoid adding dependencies whenever possible. So instead, I looked into what I was currently using to see if there was something native I could use. &lt;/p&gt;

&lt;h2&gt;
  
  
  Styled Components
&lt;/h2&gt;

&lt;p&gt;I'm working out of a legacy codebase that uses a combo stylus and styled components. We're trying to move everything to styled components, so I first looked for polyfills there. &lt;a href="https://github.com/styled-components/styled-components/issues/2078"&gt;Autoprefixer won't work&lt;/a&gt;, because it compiles at build time, where styled components are at runtime. Leaving me to rely solely on styled components for a native solution which unfortunately uses &lt;code&gt;stylis&lt;/code&gt; to compile... and doesn't have prefixing for CSS grid... yet?... &lt;/p&gt;

&lt;p&gt;I'd say "yet" but the &lt;a href="https://github.com/thysultan/stylis.js/issues/119"&gt;issue&lt;/a&gt; has been open for 2 years with no updates. I'm a huge fan of styled components, so that was a big let down. &lt;/p&gt;

&lt;h2&gt;
  
  
  Stylus
&lt;/h2&gt;

&lt;p&gt;So I looked for solution in stylus. Luckily, we happen to use &lt;code&gt;kouto-swiss&lt;/code&gt; to do our compiling (and &lt;a href="http://kouto-swiss.io/"&gt;lots of other cool stylus functions&lt;/a&gt;) which includes polyfills for grid in IE11... almost all of them. I had to do some testing to see what it actually did, because the &lt;a href="http://kouto-swiss.io/#mixins_vendors"&gt;docs&lt;/a&gt; claimed that it had polyfills for everything, including things that were not supported in IE11, like &lt;code&gt;grid-auto-flow&lt;/code&gt;. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;grid&lt;/li&gt;
&lt;li&gt;grid-area&lt;/li&gt;
&lt;li&gt;grid-auto-columns&lt;/li&gt;
&lt;li&gt;grid-auto-flow&lt;/li&gt;
&lt;li&gt;grid-auto-position&lt;/li&gt;
&lt;li&gt;grid-auto-rows&lt;/li&gt;
&lt;li&gt;grid-column&lt;/li&gt;
&lt;li&gt;grid-column-end&lt;/li&gt;
&lt;li&gt;grid-column-start&lt;/li&gt;
&lt;li&gt;grid-row&lt;/li&gt;
&lt;li&gt;grid-row-end&lt;/li&gt;
&lt;li&gt;grid-row-start&lt;/li&gt;
&lt;li&gt;grid-template&lt;/li&gt;
&lt;li&gt;grid-template-areas&lt;/li&gt;
&lt;li&gt;grid-template-column&lt;/li&gt;
&lt;li&gt;grid-template-rows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unfortunately, it doesn't tell me what versions of IE11 these were polyfills for... So I did some more digging to see what polyfills were limited to. &lt;/p&gt;

&lt;p&gt;Here's what I found... &lt;/p&gt;

&lt;p&gt;Turns out... kouto was only adding the &lt;code&gt;-ms&lt;/code&gt; prefix and not actually changing any syntax, or caring if something wasn't supported. Here's a great &lt;a href="https://css-tricks.com/css-grid-in-ie-debunking-common-ie-grid-misconceptions/"&gt;cheat sheet&lt;/a&gt; that is the most up to date version of what's supported on IE11, even with polyfills. &lt;/p&gt;

&lt;h1&gt;
  
  
  Takeaways
&lt;/h1&gt;

&lt;p&gt;Don't trust your preprocessor to do all the heavy lifting for you. Know what it's doing under the hood and test, test, test! &lt;/p&gt;

</description>
      <category>css</category>
      <category>grid</category>
      <category>ie11</category>
    </item>
    <item>
      <title>Review my Portfolio?</title>
      <dc:creator>Blair McKee</dc:creator>
      <pubDate>Mon, 26 Aug 2019 14:29:33 +0000</pubDate>
      <link>https://dev.to/theblairwitch/review-my-portfolio-b76</link>
      <guid>https://dev.to/theblairwitch/review-my-portfolio-b76</guid>
      <description>&lt;p&gt;Hey guys! I just rebuilt my portfolio in React and would love to get some feedback. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.blairmckee.com"&gt;Check it out here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I added a dark mode toggle using the Context API and had a little too much fun with the 80's vibe. Let me know your thoughts on the design and presentation of my work. &lt;/p&gt;

&lt;p&gt;I've also recently redone my resume, any suggestions are appreciated. Here's the &lt;a href="https://docs.google.com/document/d/16mtUg08KkY_ZLZcNlYyFjU_k_Fz0iMZpn9l6VwbRNdI/edit?usp=sharing"&gt;Google doc&lt;/a&gt;&lt;/p&gt;

</description>
      <category>help</category>
      <category>showdev</category>
      <category>portfolio</category>
    </item>
    <item>
      <title>How to Write a Great Technical Blog that Ranks</title>
      <dc:creator>Blair McKee</dc:creator>
      <pubDate>Tue, 19 Mar 2019 20:16:40 +0000</pubDate>
      <link>https://dev.to/theblairwitch/how-to-write-a-great-technical-blog-that-ranks-1hn8</link>
      <guid>https://dev.to/theblairwitch/how-to-write-a-great-technical-blog-that-ranks-1hn8</guid>
      <description>&lt;p&gt;You can be a great developer, and maybe an excellent writer, too... but that doesn't mean your blogs rank well on search engines. The latter requires a great deal of practice, user research, and most of all... trial and error.&lt;/p&gt;

&lt;p&gt;Before I teach you how to write great technical blogs that also rank well on search engines... you need to know this:&lt;/p&gt;

&lt;p&gt;This blog isn't going to make you a great technical writer, nor is it going to give you a template to rank better for your target search terms. I won't discuss link building or promotion either, that's up to you.&lt;/p&gt;

&lt;p&gt;What I will do is teach you how to fine tune your blog topics so that they have the potential to rank well; how to research said topic; and guidelines for how to write about the topic in a way that answers searcher intent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Searcher Intent
&lt;/h2&gt;

&lt;p&gt;What is &lt;a href="https://moz.com/blog/google-search-intent-content" rel="noopener noreferrer"&gt;searcher intent&lt;/a&gt;? Only the most important thing in your universe, right now. Searcher intent is the driving force behind a search engine query. It could be a problem that needs to be solved, curiosity about a subject, a search for validation... I mean, think about it. Why do you use Google and other search engines?&lt;/p&gt;

&lt;p&gt;If you really don't know, take a look at&lt;a href="https://myactivity.google.com/" rel="noopener noreferrer"&gt; your activity&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now take one of the last search queries you made, and type that into your browser again. Which one of the ten links did you end up clicking on? (hint: if you're on the same device, it will be purple). Why did you click that link? Did you find your answer there? Or did you click more than one?&lt;/p&gt;

&lt;p&gt;Hopefully, you got lucky and didn't have to click anything and you were able to glean an answer from the &lt;a href="https://moz.com/blog/ranking-zero-seo-for-answers" rel="noopener noreferrer"&gt;featured snippet&lt;/a&gt;... lucky you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fysjllepkiooihj7hpw6n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fysjllepkiooihj7hpw6n.png" alt="Featured snippet"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's because the page that ranks for that featured snippet solves the user intent concisely and accurately.&lt;/p&gt;

&lt;p&gt;In the example above, I wanted to know how much wood a woodchuck could chuck. I didn't even have to scroll down to the search results, because the featured snippet has the answer bolded for me right there.&lt;/p&gt;

&lt;p&gt;When you write your own technical blogs, you need to keep searcher intent at the forefront of your mind... and actually, at the forefront of your article. Most featured snippets grab their content from text that is above the fold --that's the content that's within the viewport when you load the page without having to scroll.&lt;/p&gt;

&lt;p&gt;Run a couple of searches yourself and see where the featured snippet content comes from. It's most likely at the top of the page, in a short paragraph.&lt;/p&gt;

&lt;p&gt;Now, why would you want to answer the user intent like this? If they can get their answer from the search result page, why would they ever click on the link to your site? Isn't this counterintuitive to the whole motivation behind better search engine ranks?&lt;/p&gt;

&lt;p&gt;I mean, the whole reason you are interested in SEO is because you want site traffic...&lt;/p&gt;

&lt;p&gt;Because if you're writing a technical blog, nine times out of ten your target searchers are going to need more than a single sentence answer.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Think of featured snippets as your opportunity to show searchers that you have the answers, you are the authority on this topic, and they should click your link (rather than the #1 ranked page) to learn more.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, featured snippets are the endgame, the ultimate prize in SEO... in order to get there you first need to try to rank for the #1, 2, 3, 4, 5 slots on the search result page. To do that, you need to also answer searcher intent above the fold, concisely, and then give a quick preview of all the other great things searchers will learn if they keep reading.&lt;/p&gt;

&lt;p&gt;If you ever dipped your toe into the world of SEO before, you might be screaming at the computer right now saying "No that's not right! Google will only show the meta description, so on-page content doesn't matter!"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://moz.com/blog/why-wont-google-use-my-meta-description" rel="noopener noreferrer"&gt;Things changed&lt;/a&gt;, thankfully...&lt;/p&gt;

&lt;p&gt;In case you're new to this, meta tags are HTML elements that you stick in the header of each page that contain the page title, description, and keywords. &lt;a href="https://yoast.com/meta-keywords/" rel="noopener noreferrer"&gt;Meta keywords&lt;/a&gt; have since been deprecated, but meta descriptions are now on their way out too.&lt;/p&gt;

&lt;p&gt;Don't believe me? Run a search for something, a question maybe, then view the source of a top-ranked page. Does the meta description contain the same text that you saw on the search result page? More than likely, the two will differ.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Search result description:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ffjxh6gs1lns8e3wm3h3g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ffjxh6gs1lns8e3wm3h3g.png" alt="Search result description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Meta description:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3h8fj0cnhf0ewkamc3qq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3h8fj0cnhf0ewkamc3qq.png" alt="meta description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the last few years, Google stopped relying solely on meta descriptions for page descriptions. Instead, it crawls the page content and generates its own description for the page using snippets of text. You'll also notice that the search query is bolded in the description.&lt;/p&gt;

&lt;p&gt;So the above the fold content on your blog is crucial for better rankings, as well as high click-through rates.&lt;/p&gt;

&lt;p&gt;By this point, you have an understanding of searcher intent, you are caught up on modern SEO practices, and hopefully the gears are starting to turn and you're ready to get writing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose a Topic
&lt;/h2&gt;

&lt;p&gt;Let's start by choosing a topic. This is actually the hardest, longest step, so take your time and don't be hasty.&lt;/p&gt;

&lt;p&gt;You shouldn't be pulling your topic out of thin air, there should be a "need" for this topic. Or as we mentioned earlier, searchers should be asking their search engines about your topic.&lt;/p&gt;

&lt;p&gt;If you are writing for work, check your support system. Don't have one? Check wherever you get client feedback.&lt;/p&gt;

&lt;p&gt;Already have a topic? Great, let's put it to the test.&lt;/p&gt;

&lt;p&gt;All you need is a single word, or maybe a few words, like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;DNS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Failover not working&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Secondary DNS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;DNS not resolving&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I work for a &lt;a href="https://constellix.com/" rel="noopener noreferrer"&gt;DNS hosting company&lt;/a&gt;, so I'll be using examples from my own work when I write technical blogs and articles for our website.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make Sure Your Idea Hasn't Been Done Already
&lt;/h2&gt;

&lt;p&gt;Run a quick Google search for your topic, it doesn't have to be a full sentence or even a question. If you are using more than one word, wrap it in quotes. Are there already blogs, articles, or forums that explain what you're looking for?&lt;/p&gt;

&lt;p&gt;Since we're talking about technical content, forums are usually your gold mine. Here you can find people talking about your topic in their own words. Read both the question and the comments, because you'll usually find the question asked multiple ways or at least links to other similar questions.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Forums are you most valuable resource, because you'll find people talking about your topic in words you never would have thought of, or put together in that order. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Write them down, because that's your searcher intent right there.&lt;/p&gt;

&lt;p&gt;If you answered yes, there's already content on your topic? Then maybe you shouldn't write about that... just kidding! First, ask yourself these three questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Are they good articles? Do you have to go to more than one article to fully answer your question? This could be an opportunity for you to combine a couple of articles together to make one awesome blog.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Are the first five sources Wikipedia, a news organization, ServerFault (within the last two to three years), or another authoritative source? This does not include other providers or personal/tech blogs. Reddit doesn't count either. If you said yes, then maybe you should choose another topic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Are you seeing a wide variety of articles about your topic that are completely unrelated to each other? Maybe you need to fine-tune your topic a little more...&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you make it through all three questions and still feel like you have a strong topic, let's roll! Because at this point, you know that your topic is popular, there's a need for answers, and no one else has written about it as thoroughly as you can.&lt;/p&gt;

&lt;p&gt;Did you answer no to the first question, no there isn't any content on my topic?&lt;/p&gt;

&lt;p&gt;That may mean that there aren't enough people talking about it or there isn't a good enough article that answers the question.&lt;/p&gt;

&lt;p&gt;Even scarier... this could also mean that no one cares about your topic.&lt;/p&gt;

&lt;p&gt;Let's rule that out really quick by doing some keyword research. I recommend using &lt;a href="https://answerthepublic.com/" rel="noopener noreferrer"&gt;Answer the Public&lt;/a&gt;, it's a free keyword visualization tool that shows you related keywords and questions about your topic. Also, the annoyed man on the homepage makes me giggle.&lt;/p&gt;

&lt;p&gt;If you search for "DNS" you'll see something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F7b82h2hqvn6h2im4s5um.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F7b82h2hqvn6h2im4s5um.png" alt="Answer the Public result for DNS"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The more branches and sub-branches, the more popular your topic is. If you don't see a lot, maybe they haven't indexed it... or maybe your topic sucks (just kidding!).&lt;/p&gt;

&lt;p&gt;You have to make a decision here, either stick with your potentially unpopular topic... or start over with something new. Up to you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Give Your Topic Direction
&lt;/h2&gt;

&lt;p&gt;Now that you have your topic, you'll need to whittle it down into something you can write about. Because right now, all you have is a concept with no direction.&lt;/p&gt;

&lt;p&gt;Let's do some more keyword research! Take your Answer the Public results and zoom in on each branch.&lt;/p&gt;

&lt;p&gt;I usually focus on the "how" and "what" branches. Here you'll find your most basic, general questions that users are searching for about the topic. These queries should also give you an idea of how users want to apply the concept and could give you valuable use cases you can use as examples.&lt;/p&gt;

&lt;p&gt;Let's look at the "how" branch. Start at the darkest query (the darker the green dot, the more popular the query), in this case, "how DNS works" is the most popular search query.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fm5rriwkdlqwdkra2j890.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fm5rriwkdlqwdkra2j890.png" alt="Answer the Public result for DNS"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now work your way down through the list, and you'll notice that most of the questions revolve around the DNS lookup process. Makes sense, it's confusing.&lt;/p&gt;

&lt;p&gt;But these are queries that have already been answered, by many sources, in detail. Even Wikipedia and ICANN have articles on the DNS lookup process, and those kinds of sources are extremely difficult to outrank.&lt;/p&gt;

&lt;p&gt;In this case, since DNS is a very popular topic, I would stay away from the "how" and "what" questions and would move on to less popular topics.&lt;/p&gt;

&lt;p&gt;It's also a good idea to steer clear of opinionated queries that you'll find in the "which" or "why" branches.&lt;/p&gt;

&lt;p&gt;So let's look at something with a higher search ranking opportunity. Switch over to the less popular branches, like "will" and "can". Here you'll see less generic queries like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Will DNS affect ping/speed/download speed (usually revolves around public DNS, not something a DNS hosting company is interested in)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Will changing DNS affect email&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;DNS will not resolve (still too general)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Can DNS names have hyphens (off topic... brings up domain registration stuff)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Can DNS redirect HTTP to HTTPS (oh look! We're already #1 for that)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are some solid blog ideas here... but keep in mind that they need to also be relevant to our target industry (in this example, that would be Managed DNS).&lt;/p&gt;

&lt;p&gt;That means, stay away from public DNS, private DNS, and general Sys Admin troubleshooting issues.&lt;/p&gt;

&lt;p&gt;Now there are some exceptions. If there are industries you are trying to get into, or there are slight overlaps in topics... go ahead and work on those topics. Just use your best judgment, and if you feel like you're reaching, you probably are.&lt;/p&gt;

&lt;h2&gt;
  
  
  Research Time!
&lt;/h2&gt;

&lt;p&gt;At this point, you have a topic and a direction. Now you need to do your due diligence and find out everything that's already been written about the topic.&lt;/p&gt;

&lt;p&gt;You can use this information later when you write the article. You can either paraphrase something you found interested/relevant/necessary... or cite it and link to it. Up to you.&lt;/p&gt;

&lt;p&gt;Usually, I cite and link out to content that I think is relevant, but not necessary in this article. I paraphrase stuff that is essential, like definitions or processes, and then link to my source.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use inline links to keep it clean and readable, and don't say "read more", it detracts from the flow.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Confused? Don't worry, I'll walk you through an example topic/blog.&lt;/p&gt;

&lt;p&gt;Let's go with the "will changing DNS affect email" topic. Google it and you'll see results from hosting companies, Quora, forums, and more hosting services.&lt;/p&gt;

&lt;p&gt;Don't get discouraged if you see a lot of companies/providers or forums ranking high for a query. Usually, that means there's the opportunity for you to rank well, too as long as your content is more valuable to searchers.&lt;/p&gt;

&lt;p&gt;As long as you don't see what are obviously authoritative, undeniably third-party sources (like Wikipedia or organizations that were created to be the authority on the topic) ranking in all of the top five slots... you have a chance to rank well.&lt;/p&gt;

&lt;p&gt;Even if the top five positions are taken, you still have a chance if you can create a really thorough and well-researched article that discusses related topics and links to credible sources.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is your golden opportunity to be the authoritative source on your topic.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Go to the first five results, read the articles, take notes. Write down the exact questions (if it's a forum) that users asked, jot down the answers, and anything you find interesting.&lt;/p&gt;

&lt;p&gt;If you consistently see a similar phrase, Google it, this could be a related topic that you could touch on or even write about later.&lt;/p&gt;

&lt;p&gt;At this point, you should have enough information to start writing. If you don't... maybe you need to go back to your keyword research and find another direction to go with your topic.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tips for Research
&lt;/h3&gt;

&lt;p&gt;Use your discretion when you read answers on ServerFault, Reddit, Spiceworks, or any other forum. If there are a lot of upvotes, comments from people who used the solution as well, I would trust the answer. But if it looks fishy, I would steer clear from using that answer as a source (whether you cite it or not).&lt;/p&gt;

&lt;p&gt;Same applies to Wikipedia. If there is a citation, follow it and make sure it is credible.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Bottom line, if it looks like a duck, walks like a duck, quacks like a duck.... If you have one iota that it could possibly be a duck... Don't use it in your blog because it's probably a duck.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are better sources out there, I promise! If not, then you could become that source, as long as you are confident that your information is true and helpful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's Get Down to Business (I mean writing)
&lt;/h2&gt;

&lt;p&gt;First, give yourself a pat on the back because you've done all the hard work already. Now all you have to do is turn your mess of research and citations into something cohesive.&lt;/p&gt;

&lt;p&gt;Remember that you can do multiple drafts, the first time you write this is not going to be what you end up publishing... and that's okay!&lt;/p&gt;

&lt;p&gt;Here's a sort of template that I follow when I write technical blogs:&lt;/p&gt;

&lt;p&gt;Write the title last. When you do write the title... write at least three.&lt;/p&gt;

&lt;p&gt;Start your blog with a single, two to three sentence paragraph that introduces what the article will cover. This is where you answer user intent and what you ideally want to show up in featured snippets. Keep it concise. Again, you can do this last as well.&lt;/p&gt;

&lt;p&gt;If your blog answers a question, reiterate it. And iterate multiple times in different ways. Always make sure you phrase the question the same way a user would. Even better if you can copy and paste an actual user's question. You can format this in bullets, like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;How do you move traffic from one server to another?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How can I redirect users away from a downed resource?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Can you failover traffic from one inbound ISP to another?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then, I would explain/define any terminology that is central to the topic. If I was writing a blog about how to setup Failover, I would explain what Failover is and link to any relevant articles or tutorials.&lt;/p&gt;

&lt;p&gt;Don't be afraid to use diagrams, just cite where you got it from. Google images does not count! Find the original source and give them credit.&lt;/p&gt;

&lt;p&gt;Now you can get into the meat of your blog. If you are explaining a process, ie: how to do something, or a troubleshooting process... use headers to denote the steps.&lt;/p&gt;

&lt;p&gt;For example, use H2 headings for each step and number them, like: "#2 Check if the computer is plugged in".&lt;/p&gt;

&lt;p&gt;That brings us to our next tip... use headings! I use a &lt;a href="https://wordpress.org/plugins/easy-table-of-contents/" rel="noopener noreferrer"&gt;Wordpress plugin&lt;/a&gt; to generate a table of contents for each blog based on the headings. Headings also break up your content into short digestible sections, making long articles (which technical blogs so often are) easier to read and less intimidating. So get in the habit of using headings, it'll make your life, and your reader's experience much easier!&lt;/p&gt;

&lt;p&gt;Feel free to use lists (unordered and ordered, both get indexed by Google and will show up in featured snippets), block quotes for something important (single sentence, though), and images.&lt;/p&gt;

&lt;h3&gt;
  
  
  If you hit a roadblock...
&lt;/h3&gt;

&lt;p&gt;Maybe text isn't the right way to convey what you are trying to get across to the reader. Try another type of medium like a graphic, flow chart, video, or a GIF.&lt;/p&gt;

&lt;p&gt;Take a break. If you find yourself deleting and rewriting something over and over again, you need to take a break. It will come to you when you least expect it.&lt;/p&gt;

&lt;p&gt;Go back to your keyword research and see if there's a related topic you could talk about in tandem with the current one.&lt;/p&gt;

&lt;p&gt;Recruit a beta reader, or as I fondly call them "guinea pigs", to read what you have and give you feedback. Try to not be resistant to negative critique, after all, you did ask for their opinion. Listen and digest. If it doesn't work for you, then let it go.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Technical writing should be written by technical people, like you; not hired copywriters with no actual experience. This is your medium, your opportunity to share your experiences, talk about what interests you, and educate others. Take advantage of it.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>blogging</category>
      <category>writing</category>
      <category>tips</category>
    </item>
    <item>
      <title>What Web Devs Can Learn from the Top 10 eCommerce Sites on Cyber Monday</title>
      <dc:creator>Blair McKee</dc:creator>
      <pubDate>Tue, 27 Nov 2018 19:34:50 +0000</pubDate>
      <link>https://dev.to/theblairwitch/what-web-devs-can-learn-from-the-top-10-ecommerce-sites-on-cyber-monday---------2ko8</link>
      <guid>https://dev.to/theblairwitch/what-web-devs-can-learn-from-the-top-10-ecommerce-sites-on-cyber-monday---------2ko8</guid>
      <description>&lt;p&gt;Originally, I planned to only monitor network and onpage performance metrics of the top ten eCommerce sites on Cyber Monday. But after crunching the numbers, I found something I hadn't anticipated... third-party tracking tags are taxing a significant toll on page load times.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JtlinI5B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh6.googleusercontent.com/reqQ4pHde3vbW0wuYvCxzwal_I2jXd8A0OZQJgWhFGq-xkQpfyWCGqS553L-7Zg7vz9f4-yESViWldsUKvBJZpAFWpHtPImcxWj9HK1fdYc9ua6Tn2OV72RonA3BX-oJuJ2XR0wy" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JtlinI5B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh6.googleusercontent.com/reqQ4pHde3vbW0wuYvCxzwal_I2jXd8A0OZQJgWhFGq-xkQpfyWCGqS553L-7Zg7vz9f4-yESViWldsUKvBJZpAFWpHtPImcxWj9HK1fdYc9ua6Tn2OV72RonA3BX-oJuJ2XR0wy" alt="Number of tracking tags vs page load times" width="773" height="507"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The chart above shows the top ten sites from shortest to longest DOM load time. I noticed that sites with more trackers had consistently longer DOM, total load, and finish times. &lt;/p&gt;

&lt;p&gt;Actually, third-party trackers had more of an impact on load times than requests or page size! Some websites took over a minute to fully load because they were waiting on requests for tracking beacons. &lt;/p&gt;

&lt;p&gt;You might know these trackers as pixels or beacons. They are very small scripts that capture information about website visitors and send that info to an external application for reporting. &lt;/p&gt;

&lt;p&gt;You most likely use a few of these trackers on your website and think that since they are short scripts that make a quick external call and don’t change anything in the DOM, they must be harmless. Yes and no… &lt;/p&gt;

&lt;p&gt;On their own, trackers usually won’t have any impact on user experience, since they run in the background. But, when you have dozens of requests for third-party tracking and each one takes a few hundred milliseconds to load, you could be adding valuable seconds to your load times.&lt;/p&gt;

&lt;p&gt;After looking at the top ten sites, I found that on average these sites used 24 trackers, with the peak reaching 74 trackers on a single page. That's 74 requests that could be clogging up load times or blocking other resources from rendering. &lt;/p&gt;

&lt;p&gt;Now these sites are not representative of the majority of the web, or even the kinds of projects you might be dealing with. But it's important to look at sites at this scale so that we can see how the little things can pile up and really impact user experience. &lt;/p&gt;

&lt;p&gt;Before we get any deeper… we need to talk about the different kinds of load times. There are three different ways we measure page load:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DOM Load:&lt;/strong&gt; how long it takes the browser to render all the HTML elements and scripts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Page Load:&lt;/strong&gt; DOM load + time it takes to download all the page content (images, video, etc.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Finish:&lt;/strong&gt; How long it took to send and receive all requests on the page.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Third-party trackers usually won’t load until after the DOM is loaded, which is why you will see drastic differences between the DOM load and the finish time.&lt;/p&gt;

&lt;p&gt;For example, Amazon’s DOM load took only 1.55 seconds whereas the total load time finished at over a minute. When we reran the results a second time with an Ad Blocker enabled, the finish time dropped to 45 seconds. &lt;/p&gt;

&lt;p&gt;Now 45 seconds is still a really long finish time. The culprit was a single resource that took over 30 seconds to load and inevitably failed. In this case, the DOM load was not impacted. &lt;/p&gt;

&lt;p&gt;Amazon was far from the only site affected by third-party trackers. After the first round of testing was completed, I went back and reran all the tests with an Ad Blocker enabled. &lt;/p&gt;

&lt;p&gt;I use &lt;a href="https://www.ghostery.com/"&gt;Ghostery&lt;/a&gt;, a Chrome extension that prevents ads from showing on web pages as well as restrict trackers from scraping sensitive information. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--U3qPve7v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/ZIEk5L2vBTDlLGZUA-7mLMcVCHXBJ5uqusyY25wF3ugP61xbj3UIRo2L0lka-Nm9b724IxnECFEqInxj4WodL0429W2MJnoK4qwQUtj8yQn8cjH2TwNl06bgE1BL4oOgUQeRh3qu" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--U3qPve7v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/ZIEk5L2vBTDlLGZUA-7mLMcVCHXBJ5uqusyY25wF3ugP61xbj3UIRo2L0lka-Nm9b724IxnECFEqInxj4WodL0429W2MJnoK4qwQUtj8yQn8cjH2TwNl06bgE1BL4oOgUQeRh3qu" alt="Ghostery Screenshot" width="660" height="596"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also used &lt;a href="https://constellix.com/sonar/sonarliteextension/"&gt;Sonar Lite&lt;/a&gt;, a free Chrome extension that uses Real-Use Monitoring to capture page loads and request timings. Shameless plug, I also work for Constellix.. but it is a fantastic free tool that makes life easier than opening up dev tools and hard reloading the page every time I want performance metrics. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9WNTrbM_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/VoQ8iN837MQy6zmmyYpZ1axnMb6drspHVQ0CNyhdRSMXN8cnPDDOFVr1Xhpodk55sB6FZ7OQzokXHlllCdKdUDuLRvpJM5qyTihmpWLyz_XwOQ0Jmqm-NrLQWmvOYzv6w7kEbPua" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9WNTrbM_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/VoQ8iN837MQy6zmmyYpZ1axnMb6drspHVQ0CNyhdRSMXN8cnPDDOFVr1Xhpodk55sB6FZ7OQzokXHlllCdKdUDuLRvpJM5qyTihmpWLyz_XwOQ0Jmqm-NrLQWmvOYzv6w7kEbPua" alt="Sonar Lite Screenshot" width="690" height="508"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In most cases, I didn’t see much of an aesthetic difference with or without the Ad Blocker, with the exception of Kohl’s who turned their website background into an advertisement. Once I enabled Ghostery, it disappeared entirely.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--d_PVmXZD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh4.googleusercontent.com/90Kd5bijqkikcsh40RQjCkSO9v65Y0Rywpxhn0PHDosMvJWJnyFwz1mzE71yzMgR2m2Vdyft0HZCyodQLYg7Pn82ju5GUEWf7DVeEiQ0qgSn5e2KnXtqmHzNAFObbxyiypobxz0G" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d_PVmXZD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh4.googleusercontent.com/90Kd5bijqkikcsh40RQjCkSO9v65Y0Rywpxhn0PHDosMvJWJnyFwz1mzE71yzMgR2m2Vdyft0HZCyodQLYg7Pn82ju5GUEWf7DVeEiQ0qgSn5e2KnXtqmHzNAFObbxyiypobxz0G" alt="Screenshot of Kohl's homepage with and without Ad Blocker" width="880" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And pages that took a long time to render the initial paint (how long it takes to render the visual elements in the browser) still took the same amount of time. &lt;/p&gt;

&lt;p&gt;All of this was as expected... until I crunched the numbers and compared them to the first test: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DOM loads reduced by an average of 8.9% when we used an ad blocker.&lt;/li&gt;
&lt;li&gt;Total page loads (including images) were reduced by a whopping 17%.&lt;/li&gt;
&lt;li&gt;Page size slashed by 24%&lt;/li&gt;
&lt;li&gt;Requests reduced by 43%&lt;/li&gt;
&lt;li&gt;Third party trackers were cut in half, down by 58%&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W2Icl5hk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/0K5O20KeP1wVoGseAWID5kxXNuMCBWPyW1aKt5a9RrqKhertjOEaILtN1kk3qCDmX4PiLL1xZvVOeknWNDwhJolRW9Bq9C-GnAhf-UXu4Tgak3ytLLm-qq72m63zi8D_b0pkWILU" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W2Icl5hk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/0K5O20KeP1wVoGseAWID5kxXNuMCBWPyW1aKt5a9RrqKhertjOEaILtN1kk3qCDmX4PiLL1xZvVOeknWNDwhJolRW9Bq9C-GnAhf-UXu4Tgak3ytLLm-qq72m63zi8D_b0pkWILU" alt="Performance of top eCommerce sites with an Ad Blocker" width="771" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’ll notice that the number of trackers didn’t drop to zero. There are still some trackers being used even when we have the ad blocker enabled because these trackers are considered “essential” by Ghostery and all of our data is anonymized before being sent off. &lt;/p&gt;

&lt;p&gt;But when you remove the majority of the trackers, all three load metrics, the number of requests, and page size dropped significantly. &lt;/p&gt;

&lt;p&gt;So why should this matter to you? Well if you use third-party trackers, you need to be aware of the performance impact. &lt;/p&gt;

&lt;p&gt;The websites we monitored in this study are the epitome of optimal web performance. They religiously use (and establish) the best practices for web performance and efficient web development. Despite that, they still suffer from the same pitfalls as everyone else due to overuse of third-party tracking scripts. &lt;/p&gt;

&lt;p&gt;When I reran the tests with the trackers removed, the average DOM load time dropped from 1.9 to 1.7 seconds. That may seem inconsequential, but when you have thousands of millions of people using your site at the same time, every millisecond counts. &lt;/p&gt;

&lt;p&gt;Experts estimated that over &lt;a href="https://marketingland.com/nearly-170-million-will-shop-cyber-week-most-online-traffic-will-be-mobile-252251"&gt;75 million shoppers&lt;/a&gt; will take to the web for their Cyber Monday shopping. For the ten retail giants we monitored, that’s likely a couple million shoppers surfing their websites within a 24 hour period. &lt;/p&gt;

&lt;p&gt;If page loads dip just the slightest bit, it could cost thousands in revenue. &lt;/p&gt;

&lt;p&gt;That’s why these kinds of site are the best to learn from. They have teams of dozens of people working to keep their site lean and efficient, all to make sure performance doesn’t degrade when they are challenged by holiday shoppers. &lt;/p&gt;

&lt;p&gt;Even if you don’t have the resources or man power that these ecommerce giants have, there is still so much you can learn from them and apply to your own development projects. &lt;/p&gt;

&lt;p&gt;If there’s one thing you take away from this article, it is to be mindful of the trackers you use. Every pixel could impact performance, so don’t take those little scripts lightly. &lt;/p&gt;

&lt;h3&gt;
  
  
  Key Takeaways:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Sites with more trackers tended to have longer DOM and finish load times.&lt;/li&gt;
&lt;li&gt;However, sites with more requests did not correlate with longer load times.&lt;/li&gt;
&lt;li&gt;Pages that didn’t complete all requests had longer load times.&lt;/li&gt;
&lt;li&gt;Lazy loading (loading images and scripts on scroll) improved page loads by a few hundred milliseconds to a few seconds&lt;/li&gt;
&lt;li&gt;60% of the top websites had DOM load times under two seconds.&lt;/li&gt;
&lt;li&gt;Website sizes were unusually higher than previous years averaging 3.75 Mb, nearly double the recommended size of 2Mb.&lt;/li&gt;
&lt;li&gt;Trackers accounted for an average of a megabyte of website size.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Results:
&lt;/h3&gt;

&lt;p&gt;Here are the results from the two sets of tests. Each cell contains the difference between the first set of tests and the second set when I used an Ad Blocker. Red cells indicate an increase in load times or # of requests/trackers. Green cells indicate improvement and a reduction in load times or # of requests/trackers when we used an Ad Blocker.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yc39cxDf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh6.googleusercontent.com/rMKacyUerTB1A4UYRoc_J_L9FLghc7x_BO8nmGq4Of1F19mAb4g8fEevnDTUqxUHQWOQ87Ze1j2YlOPVOZ-ZMWNQ6uWOn-I1CDM5T_acY4DCjjvRiQ0RJYyATQDRyiWaFXeZP0oH" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yc39cxDf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh6.googleusercontent.com/rMKacyUerTB1A4UYRoc_J_L9FLghc7x_BO8nmGq4Of1F19mAb4g8fEevnDTUqxUHQWOQ87Ze1j2YlOPVOZ-ZMWNQ6uWOn-I1CDM5T_acY4DCjjvRiQ0RJYyATQDRyiWaFXeZP0oH" alt="Difference between using an Ad Blocker and not" width="821" height="321"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let me know what you think of this study. Were you surprised by the results? Did you see something in the data that I didn't catch? I'd love to hear your findings. &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>performance</category>
    </item>
  </channel>
</rss>
