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

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.

0 Likes
Shopify Partner
25 0 4

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
1 Like
Shopify Partner
3 0 2

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

2 Likes
Shopify Partner
1 0 2

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

2 Likes
Tourist
4 0 5

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

5 Likes
New Member
1 0 0

hi i dont see navigation . Solution ?

0 Likes
New Member
1 0 4

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

4 Likes
New Member
1 0 0

very useful bro

0 Likes
Highlighted
Tourist
5 0 1

Thank you!

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

1 Like
New Member
1 0 0

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.

0 Likes