How can I add an ads.txt file to my site for AdSense?

Solved

How can I add an ads.txt file to my site for AdSense?

Infernox
Excursionist
17 1 4

Hi guys,

 

Recently I've been getting an Red alert at the top of my Adsense account that says:

 

"Earnings at risk – One or more of your sites does not have an ads.txt file. Fix this now to avoid a severe impact on your revenue."

 

How do I add this ads.txt file to my shopify site? You can see the instructions here: https://support.google.com/adsense/answer/7532444?hl=en-GB

 

I searched this forum and someone asked this in 2017 but no one could answer it. https://community.shopify.com/c/Shopify-Discussion/How-to-add-an-Ads-txt-file-to-a-Shopify-site/td-p...

Accepted Solution (1)
AG-Mens-Jewelry
Excursionist
12 1 20

This is an accepted solution.

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

Upload Adsense txt file to shopify assets folderUpload Adsense txt file to shopify assets folder

 

 

 

  • Go to Online Store > Navigation > Url Redirects

Shopify-Navigation-URL-RedirectsShopify-Navigation-URL-Redirects

  • Create a redirect rule from /ads.txt to /file_url

Creating Adsense txt redirect for shopifyCreating Adsense txt redirect for shopify

 

Hope this helps everyone and please allow 24 - 48 hours for your Adsense account to approve your txt file has been uploaded to your domain server.

View solution in original post

Replies 16 (16)

PaulNewton
Shopify Partner
6848 615 1447

Did you try the redirect method outlined in the post you linked?

 

Main issue is assets go on shopifys cdn with is a different domain that  .myshopify.com

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


CholeWess
Excursionist
11 0 2

The work around suggested doesn't work for the required txt file, it only allows google to verify your domain.  I've tried using the code they provide as a txt record as well but it did not work.  This is so frustrating.  I asked Shopify after Google instructed me to contact my domain administrator and they provided me the same link in the original question above.  I tried it just to see if maybe it would work and it didn't.  Disheartening that our own platform can't assist with this.

PaulNewton
Shopify Partner
6848 615 1447

@CholeWess wrote:

I've tried using the code they provide as a txt record as well but it did not work.


You mean as Domain TXT record in your domain ?

Or as a file you added to the shopify admin assets?

 

Is shopify your domain name registrar?

https://help.shopify.com/en/manual/domains/managing-domains/advanced-settings

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


Infernox
Excursionist
17 1 4

Did you end up getting it to work? It still shows up on mine.

Tavor_Summits
Shopify Partner
4 0 0
Yes!
We got this to work and the warning's gone.
What steps did you take in your attempt to solve your issue?
Shopify Partner | Klaviyo Master
AG-Mens-Jewelry
Excursionist
12 1 20

This is an accepted solution.

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

Upload Adsense txt file to shopify assets folderUpload Adsense txt file to shopify assets folder

 

 

 

  • Go to Online Store > Navigation > Url Redirects

Shopify-Navigation-URL-RedirectsShopify-Navigation-URL-Redirects

  • Create a redirect rule from /ads.txt to /file_url

Creating Adsense txt redirect for shopifyCreating Adsense txt redirect for shopify

 

Hope this helps everyone and please allow 24 - 48 hours for your Adsense account to approve your txt file has been uploaded to your domain server.

artosien22
Visitor
1 0 1

Your instructions are the most helpful one I've come across, I've been trying to solved this problem for my site for quiet sometime now. Thanks for your help really appreciate it. 

VesperandVine
Tourist
3 0 1

Thank you for such a great answer.

iway
Visitor
1 0 0

Hello

 

Its not working is deleting the "cdn.shopify" part and just leaving /s/files/1/2501/7648/files/Ads.txt

and the resulting links goes to nowhere https://www.iwaymagazine.com/ads.txtshopifyredirect.jpegshopifyredirect2.jpeg

 

AG-Mens-Jewelry
Excursionist
12 1 20

@iway You need to use the entire url and you need to switch your inputs around. Your issue is that the url and ads.file are in the wrong boxes.

Example: 

Redireccionar desde     

/ads.txt

 

Redireccionar hacia

Place your https://cdn.shopify.com/s/files ...url

AdSense Example.JPG

Uchechi
New Member
4 0 0

I couldn't find redirect rule. 

Tavor_Summits
Shopify Partner
4 0 0

If you're still seeing the warning after implementing the solution we can help.

Shopify Partner | Klaviyo Master
Uchechi
New Member
4 0 0

All good now.

Thanks

Tavor_Summits
Shopify Partner
4 0 0

Hi, we can solve this for you.

https://experts.shopify.com/prosale/domain-setup

We'll need your ads.txt file + full access to your store and Google will verify within 24-48 hours (or your money back!).

Clean, white-hat methods only - we do this on our own stores too.

Shopify Partner | Klaviyo Master

ViktorShtodler
Shopify Partner
2 0 3

Here's how you can do it:

  1. Log in to your Shopify account and go to the Online Store section.
  2. Click on the Themes option and then click on the Actions button next to your current theme.
  3. Select Edit Code from the drop-down menu.
  4. In the left-hand menu, click on the "Templates" folder and then click on "Add a new template".
  5. In the pop-up window, select a template to create: robots.txt
    Screenshot_01.jpg
  6. Copy and paste the following code into the robots.txt at the bottom::

    google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0

    Replace "pub-0000000000000000" with your unique AdSense publisher ID. Screenshot_02.jpg

  7. Save the file and you're done!

    It may take a few days for the changes to take effect, but once they do, your AdSense ads should start displaying correctly.
Kingsoul
Visitor
1 0 0

I'm trying to verify my app-ads.txt file for admob for my mobile app. Will this work for that?