FROM CACHE - en_header

How to add an Ads.txt file to a Shopify site

Paddy
Shopify Partner
3 0 2

Google are encouraging advertisers to host an ads.txt file at the root level of their domain. e.g. example.com/ads.txt. (https://support.google.com/dfp_premium/answer/7441288?hl=en)

How can this be done with Shopify?

Uploading an assets doesn't work because the file is hosted at a Shopify CDN URL, e.g. https://cdn.shopify.com/...

Uploading to the Files section results in the same issue.

Using either of those options and creating a redirect also does not work.

Replies 19 (19)
retention
Shopify Partner
25 0 5

Paddy,

I'm pretty sure there isn't a way for you to explicitly host a file at the root level, but there might be a work around depending on how Google follows the URL redirects.

Basically, you upload your ads.txt file in the Shopify File Upload (which goes into their CDN).  Then you create a URL Redirect which can be at the root level (example: yourdomain.com/ads.txt).

Look at the bottom of this documentation page that explains how to do this step-by-step.
https://help.shopify.com/themes/customization/store/verify-domain-with-third-party-services

Let us know if Google accepts this method and I hope this helps!

Joe

// Retention Commerce | retentioncommerce.com
Paddy
Shopify Partner
3 0 2

Thanks for the reply Joe, Google doesn't support this method. Any other ideas?

Felipe_Pontes_G
Shopify Partner
1 0 2

I need help with that too. How do you host a ads.txt file?

papavince
Shopify Partner
20 0 15

Hello, Download your Ads.txt. Go to setting then Files upload your downloaded ads.txt Copy the URL. Then go to your navigation create URL directs. Paste the direct URL to  Redirect to and add ads.txt to Redirect from. Thanks, Vince Servidad.

ads txt.JPG

Shopify Expert Developer and Designer. Google Ads Expert and Klaviyo Expert for Email Marketing Automation and SMS Marketing.
ekortal
New Member
3 0 0

hi i dont see navigation . Solution ?

BuyEasy
Tourist
3 0 15

Hi,

 

1. First go to settings > files - and upload the file ads.txt

2. then go to online store > navigation and on the top you will see "URL redirection". click on it

3. press Create URL redirection

4. Redirect from /ads.txt

5. Redirect to add the relevant URL. You need to add the relevant URL from settings>files>ads.txt there you will see the URL

 

Alex

perfektcart
New Member
1 0 1

very useful bro

INHWAN_KIM
Tourist
6 0 2

Thank you!

Your answer is a very easy way to set this! Really appreciate!

ejaynitesh
New Member
1 0 1

Hi, Even I am getting the same error on my Adsense account: Earnings at risk - You need to fix some ads.txt file issues to avoid severe impact to your revenue. My website address is: https://www.chembondindia.in and I am able to successfully get the ads.txt on appending this with ads.txt Kindly help resolve this issue or else advise on who to speak to. Thanks.

Salvador9
Tourist
4 0 4

@papavince wrote:

Hello, Download your Ads.txt. Go to setting then Files upload your downloaded ads.txt Copy the URL. Then go to your navigation create URL directs. Paste the direct URL to  Redirect to and add ads.txt to Redirect from. Thanks, Vince Servidad.

ads txt.JPG


Perfecto, this is the solution. Thank you very much!  ... Don't forget to copy the real url of the ads.txt right when you uploaded it to files, so you dont have to go back from redirect url.

papavince
Shopify Partner
20 0 15

Always welcome. Happy to help. 🙂 

Shopify Expert Developer and Designer. Google Ads Expert and Klaviyo Expert for Email Marketing Automation and SMS Marketing.
BuyEasy
Tourist
3 0 15

Hi,

 

I got this message every month since last 1 year and did nothing, as I don’t understand the reason and it’s not described in their message.

Still getting My money from google and there is no issue.

 

in other words - just ignore it :))

BuyEasy
Tourist
3 0 15

Just ignore it...I did the same since last year. No risk there and money are safe..

karife
Tourist
5 0 2

hi

a question

I have an issue with adding a file text 

what do I have to paste in  "redirect from"? 

thanks

pickgear
New Member
2 0 1

this is recommended setting, It works 

SPaco
Shopify Partner
10 1 1

I'm trying to do this the opposite way. Google is requesting a proof of domain. They're asking us to add a file to the root of Shopify, which I know isn't going to happen. But I've tried this both ways and it still goes to the file url and not the redirect.

 

Redirect this file:

https://cdn.shopify.com/s/files/1/****/****/files/analytics.txt?v=*********

 

to this url

example.com/analytics.txt 

 

and it does nothing. What am I doing wrong?

 

Thanks

karife
Tourist
5 0 2

Hi

Thanks a lot!

stellajamielui
New Member
1 0 1

Thank you!!! This is super clear & helpful!!!

techoboom
New Member
2 0 3

I was trying to fix that through the DNS record, lol... thank you for the detailed and compact explanation