To add Google AdSense to Shopify, paste your AdSense ad unit code into your store's theme.liquid file (for sitewide placement) or into a specific page template like product.liquid or page.liquid (for targeted placement). The header.liquid file is the most common insertion point. This guide walks through the exact process - from signing up for AdSense to placing the code in the right Shopify liquid file.
Is Google AdSense Compatible with Shopify?
Yes, Google AdSense works on Shopify. Shopify allows merchants to edit their theme's HTML and Liquid files, which is all that's needed to insert AdSense ad unit code. However, there is an important consideration: AdSense is a display advertising network designed for content sites. On a product-focused Shopify store, ads may distract visitors from making a purchase - which typically has a higher revenue value per visitor than an AdSense click.
AdSense on Shopify makes the most commercial sense if your store has a blog with significant organic traffic, a content section with high page views, or informational pages that don't directly drive transactions. Placing ads on product pages or the checkout flow is generally counterproductive and may violate AdSense's policies.
Step 1: Sign Up for Google AdSense
To get started, go to the AdSense website and click "Get Started." Provide your Shopify store's URL and confirm it complies with AdSense program policies (your store must have original content, clear navigation, and a privacy policy).
Select whether you're registering as an individual or a business. Fill in your name, address, and phone number. You can add payment information after approval.
Google typically reviews applications within a few days. Once approved, you'll receive an activation email with instructions to verify site ownership by adding a small code snippet to your store - this is done the same way as the ad code placement described below.
Step 2: Generate Your Ad Unit Code
Log in to your AdSense dashboard and navigate to Ads → By ad unit. Choose an ad type:
- Display ads: Standard banner or box ads. Most versatile for Shopify placement.
- In-feed ads: Designed to blend into lists of articles or products - works well in blog listing pages.
- In-article ads: Designed to appear between paragraphs of text - best suited for blog post content.
For most Shopify stores, Display ads with Responsive sizing are the right starting choice - they adapt to any screen size automatically. Give your ad unit a descriptive name (e.g., "Shopify Blog Sidebar"), then click Create. Copy the full JavaScript code snippet that AdSense generates.
Step 3: Where to Add Google AdSense Code in Shopify
This is the most searched question for this topic - and it depends on where you want the ads to appear.
Log in to your Shopify admin and go to Online Store → Themes → Actions → Edit code.
For sitewide ads (appears on every page)
Open Layout → theme.liquid. Paste your AdSense code just before the closing </head> tag. This is also where you paste the AdSense site verification snippet if you're setting up AdSense for the first time.
For blog post ads only
Open Templates → article.liquid (or Sections → main-article.liquid if using a newer Online Store 2.0 theme like Dawn). Find the area where the article body renders - typically {{ article.content }} - and paste your ad code above or below it.
For homepage ads only
Open Templates → index.liquid or the relevant section file. Insert the ad code in the area of the page where you want the ad unit to appear.
For specific pages (like an About page)
Open Templates → page.liquid and insert the code in the appropriate location relative to {{ page.content }}.
After pasting the code, click Save in the Shopify editor. Preview your store to verify the ad unit renders where expected. Note that new AdSense units may take a few hours to start displaying ads while Google's crawler indexes your pages.
Using AdSense Auto Ads (Easier Alternative)
If manually placing code in liquid files sounds complicated, AdSense's Auto ads feature is a simpler alternative. Auto ads require only a single code snippet added to your <head> section once - Google then automatically identifies the best ad placements on your store and inserts ads without further configuration.
To enable Auto ads: in your AdSense dashboard, go to Ads → Overview → Get code, copy the Auto ads snippet, and paste it in your Shopify theme.liquid before the closing </head> tag. That's the entire setup process.
Troubleshooting: Why Are My AdSense Ads Not Showing on Shopify?
After adding your AdSense code, ads may not appear immediately or at all. Here are the most common causes and how to fix each one.
- Account still under review. New AdSense accounts go through a site review that can take 1-14 days. No ads will show during this period even if the code is placed correctly. Check your AdSense dashboard for account status.
- Code placed in the wrong file. If you added the code to a section file that only loads on certain page types, ads won't appear everywhere. Move the code to
theme.liquid(before</head>) for sitewide coverage. - Ad blockers preventing display. Test from a browser without any ad blocker extensions. Many users and store owners run ad blockers that suppress AdSense even when everything is configured correctly.
- Content policy issue. AdSense may suppress ads on pages it considers low-value, thin, or policy-violating. Check your AdSense dashboard under Policy Center for flagged pages.
- Auto ads crawl delay. Auto ads require Google to crawl your store before it can identify ad placement opportunities. After first setup, wait 24-48 hours before expecting consistent ad delivery.
- Shopify theme JavaScript conflict. Some themes load scripts asynchronously in ways that can interfere with AdSense rendering. Try switching to a default Shopify theme (like Dawn) temporarily to isolate whether the issue is theme-specific.
Benefits of AdSense on Shopify
For merchants with content-rich stores, AdSense offers several advantages:
- Passive revenue from non-converting traffic: Visitors who arrive via informational blog posts and don't purchase can still generate ad revenue.
- No setup beyond code placement: Google handles ad selection, delivery, and payment automatically.
- Advanced targeting: AdSense's targeting ensures ads are contextually relevant to your content and visitor interests.
- Detailed analytics: The AdSense dashboard reports impressions, clicks, CTR, and estimated earnings - useful for evaluating which content pages generate the most ad revenue.
- Global reach: AdSense monetizes traffic from virtually any country.
Realistic AdSense Revenue on Shopify
Before setting up AdSense, set realistic expectations. AdSense pays per click (CPC) and per thousand impressions (CPM). Typical Shopify store earnings from AdSense:
- Blog-heavy stores with 10,000+ monthly page views: $30-$150/month from AdSense
- Product-focused stores with minimal content pages: $5-$30/month
- High-traffic niche stores (50,000+ views): $200-$800/month depending on niche CPCs
Finance, insurance, and legal niches have the highest CPCs ($3-$15 per click). Fashion, food, and lifestyle niches typically see $0.10-$0.50 per click. Your earnings depend almost entirely on your traffic volume and niche.
Common AdSense Mistakes on Shopify
These are the errors that get Shopify store owners rejected from AdSense or banned after approval:
- Too many ads above the fold. Google penalizes pages where ads push the main content below the visible area. Stick to one ad unit in the header or sidebar, not both.
- Placing ads on checkout pages. Never add AdSense code to checkout.liquid or cart.liquid. Google prohibits ads on transaction pages, and it also distracts customers from completing their purchase.
- Not having enough content. AdSense requires original, valuable content. A Shopify store with only product pages and no blog will likely get rejected. Add at least 15-20 blog posts before applying.
- Clicking your own ads. Google detects self-clicks immediately. Even accidental clicks during testing can trigger a review. Use AdSense preview mode instead of live ads when testing placement.
- Ignoring mobile placement. Over 70% of Shopify traffic is mobile. Test how your ads look on phones. Auto ads handle this well, but manual placements often break mobile layouts.
AdSense Alternatives for Shopify Stores
If AdSense doesn't fit your store, or if you get rejected, these alternatives work with Shopify:
- Ezoic - works with sites getting 10,000+ monthly visits. Often pays 50-200% more than AdSense through automated ad testing.
- Mediavine - requires 50,000+ sessions/month but pays significantly more. Best for content-heavy Shopify stores with large blogs.
- Amazon Associates - product-focused affiliate links instead of display ads. Better fit for stores where you can recommend related products.
- Shopify affiliate apps - if your store has traffic, consider affiliate marketing apps from the Shopify App Store instead of display advertising.
Conclusion: How to Add Google AdSense to Shopify
Adding Google AdSense to Shopify requires editing your theme's liquid files to insert the ad code - the most common location is theme.liquid for sitewide placement or article.liquid for blog-only ads. If you prefer a simpler setup, Auto ads handle placement automatically with a single code insertion. For stores with active blogs generating organic search traffic, AdSense is a practical way to monetize non-converting visits without any ongoing management. If you're also running Facebook or Instagram ads, consider our guide on Meta Pixel to Shopify to connect ad spend with actual sales data.
* read the rest of the post and open up an offer