Creating Blog site using Stackbit, GatsbyJS and DEV -6

Welcome to part-6 of the series. You can find part-5 here.

As, you might know from earlier part that i am upgrading by personal blog site

One of the main task remaining from last post was to add advertisements to the site.

I should tell it’s a great pain to add advertisements to a Gatsby site as all the html files are generated on build. And most advertisement networks provide you javascript scripts to put in the head and the body tag.

In part-5 i had applied for google adsense account, but as my content is on three sites(even though i had canonical links to my primary domain from dev and medium) it was rejected.

After searching the internet i found this useful article containing the details of other popular ad networks.

I applied for, InfoLinks and RevenueHits and got approval from all of them. I also applied for Carbon Ads, which is nowadays very popular with developers but didn’t got the approval yet.

I decided to add ads to my site as they serve ads from yahoo network. Once you login to dashboard, you need to add a file Ads.txt in your site root directory.

Image for post
Image for post

Rest of the chapter is exclusive content and will be in my upcoming book Gatsby Cookbook.

Image for post
Image for post

Next to show the Subscribe component in the Sidebar, i had updated the Social.js file. I had included it in the file, followed by adding a React fragment and added it with passing the props heading as false.

Image for post
Image for post

And it is showing the mini Subscribe component in the Sidebar. Please do subscribe to my weekly newsletter, which will contain the updates on my posts.

You can find the code till this at my github repo here.

Hope to see you in this series again, when i make some more changes to my blog site.

Written by

UI Lead- ReactJS, JavaScript and everything in-between.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store