Here is a step by step guide about how you can integrate google adsense ads into your shopify online store
What is Google Adsense ?
Google Adsense is a great method to monetise your blog inside an online Shopify eCommerce Store. All you need to do is, have a Google Adsense Account and then get the ad codes and integrate to your shopify blog template and that’s all. You just need to concentrate on creating good content on your blog and once you get organic or paid traffic to your store or blog, you will start getting a lot of clicks on those ads and thus get paid.
Shopify Store Adsense Rule
Shopify is an eCommerce platform and we don’t recommend integrating putting ads on your shop pages or product pages or category pages. You should only show the ads on blog pages. Your viewers or potential customer should not be disturbed by showing ads when their sole aim is to read about your product and order it. So, do not integrate the ads on product pages, whatsoever. Only target should be blog pages and your aim should be how to create unique content which people would want to read and share.
How to integrate Adsense Ads to Shopify ?
- Goto Shopify Admin Backend
- Goto Online Store > Themes > Active Theme > Edit Code
- Open theme.liquid file in the code editor
- Get the adsense head code from Google Adsense panel
- Put it just before the head closing code , below is an example how I have placed it on a store
This was all the initial setup necessary. Go back to AdSense page and tell Google you uploaded the code and it will begin the verification process. This means it will verify if your site complies with their policies, if it has enough content and so on. It typically takes about a few days to a week to process, but it may take longer.
If your site does get the OK from them, you should start seeing ads on your sites within a few hours.
Once the above is done, then you will get a warning message on your AdSense account page that will tell you to solve an issue with the ads.txt file, or your income will be affected. You have to upload a file on the root of your site, that has to be accessible on the path https://yourwebsite.com/ads.txt. This may sound like nothing, but Shopify does not let you upload files/assets like that. All the files and assets are served over cdn (content delivery network), so the route to the file will look different.
Here is the solution to this issue:
Log in to your Shopify store account
Go to Settings > Files
Take the generated ads.txt file from AdSense
Upload the file on Shopify
Copy the URL of the file
Go to Online Store > Navigation > Url Redirects
Create a redirect rule from /ads.txt to /file_url
Now if you go to https://yourwebsite.com/ads.txt you will see the file. AdSense may however notify you about the missing file again, but the warnings go away in few days.