Entries in ads.txt (1)

Tuesday
Jun222021

Uploading the Google AdSense ads.txt file in Squarespace 5 

This applies to the Squarespace 5 CMS

How to upload the Google AdSense ads.txt file to the 'root' of a Squarespace 5 site

In your AdSense dashboard you may see this important-looking message:

Earnings at risk - You need to fix some ads.txt file issues to avoid severe impact to your revenue.

Google AdSense demands to see a file called ‘ads.txt’ stored in the root of your website.  Problem is, you can’t FTP into a Squarespace site, nor directly upload a file there using Squarespace’s content management system either. But you can fool the system into thinking the file is indeed in the root of your Squarespace 5 website.

This worked for me:

  1. Firstly download the corresponding ads.txt file from Google AdSense and save it to hard disk.
  2. Log into your Squarespace 5 website and in the main menu go to Website Management > Data & Media >  File Storage.
  3. You can navigate around your folders or create directories as you please, but I left it in the default ‘Storage’ folder. The ‘Upload Files’ button appears at the bottom of the page, so use it to upload your ads.txt from your PC to your choice of Squarespace folder.
  4. Still in File Storage, find the new ads.txt file in the list of files and click ‘url’. The absolute URL for your file shows near the top of the page. In my case it was http://mydomainname.com/storage/ads.txt.
  5. In Google’s eyes, this file needs to appear in the root instead (ie http://mydomainname.com/ads.txt), which can be effected using a ‘301 Redirect’ as follows.
  6. In the Squarespace 5 main menu go to Structure then URL shortcuts. Fill in the simple fields as follows:
    1. Shortcut URL  ads.txt 
    2. Target URL [in my case] storage/ads.txt
    3. Navigation method:  301 Redirect
    4. Click Update information and the changes take effect immediately.

Now test that the redirect works: type mydomainname.com/ads.txt into a browser (like Google would expect to see it), and it should automatically redirect and show your ads.txt publisher details in a new window - even though your ads.txt file isn't stored in the root.

After doing this change, Google spidered my site within four days and the AdSense warning disappeared from my AdSense dashboard. Worked a treat! (or Bob's your uncle, as we say in England.)