Hosting ads in Ghost blog
Bloggers love to write. They merely want to express their opinions because they are passionate about a subject. However, bloggers also enjoy earning money. The majority of personal blogs run advertisements because this is still the main source of money associated with blogging. Ghost blogs are another option.
Similar to how WordPress themes utilise include files, Ghost themes employ partial files. Though less sophisticated, the idea is fundamentally the same. In most circumstances, your 'index.hbs' file contains at least one partials-like file. The journeyman is the file named "default.hbs." It manifests everywhere. Although it is not technically a partials file, it functions similarly.
You can keep as many template code snippets that you wish to use in your theme but don't want hard coded into the main file in a partials folder then we can add code snippet feature to ghost.
To add Code snippet to ghost read this blog post "Code snippet in Ghost Blog platform, how does it work?"
once the code snippet feature is active all you have to do is use this command ``` and press enter to use the code snippet.
Google AdSense
The Google AdSense programme allows website owners to deliver text, image, video, or interactive media adverts that are relevant to the audience and content of their own websites.
Signing Up To AdSense
Signing up is just as easy as any other website.
- https://www.google.com/adsense/start/
- Clicked Get Started
- Put in details
Adding Ad Code to Website
Ghost has an excellent explanation on how to do this, but I'll demonstrate these processes using examples from my own work.
Connecting Site to AdSense
You will receive the necessary code snippets from AdSense to launch the adverts. Grab the code from AdSense and insert it into the header using Ghost. You may do this by going to Settings > Code Injection and pasting the code there. Mine, which also uses Google Analytics, appears as follows:
Creating Ad Units
Each individual ad placement on your page is known as an ad unit. These provide you control over the form factor and placement of your advertisements. Auto Ads are still another choice. Where Google thinks these adverts should be shown on your page is up to you. Ad Units will be used on my website.
Go to your AdSense home, select the Ads side menu option, then select one of the four options under "Create new ad unit" to start creating an ad unit. I made two Display Ads for my website, placing one at the top and one at the bottom of each post.
When creating a new Ad Unit I found that generating a horizontal advertisement still gave me a square one, I had to explicitly write it out as a horizontal ad.
that's it your all good to go.
Sit back and start earning 🫰💸