Ads.txt on SquareSpace and Other Hosted Platforms
On our quest to hit 100 percent Ads.txt adoption at Mediavine, we’ve hit some snags along the way with sites on closed, hosted platform systems such as SquareSpace, Shopify and Wix.
The Ads.txt spec requires that you upload a plain text file named ads.txt at the root of your domain. Example:
The issue with closed, hosted platforms like SquareSpace is that you don’t have the ability to upload a document to the root of your site.
Luckily, our partners at Google were able to update Blogger to support an ads.txt file, but until other similarly closed systems implement a solution, we needed a workaround.
How did we fix it?
First, let’s look at a key aspect to the technical specs behind ads.txt.
Ads.txt must be implemented at the root domain.
Why is that so critical? Because most SquareSpace, Shopify, etc., sites are hosted at a www domain.
Why does that matter? Because we can host different content on the root domain versus the www subdomain. This is the entire crux of our strategy.
We’re going to take over hosting of the apex domain, or in this case, http://thehollywoodgossip.com. If we see a request for ads.txt, we’re going to serve it.
All other requests to the naked domain? We’re going to 301 redirect to the www subdomain, or the regular SquareSpace site, which will continue serving as normal.
Now when a DSP comes looking for an ads.txt file, they’re automatically going to request it from the root domain, or:
Due to the standard, no DSP is going to request ads.txt from the www, so it doesn’t matter if we can’t upload ads.txt to our www site. No one evers check that.
We’ve confirmed that this solution works perfectly with DSPs such as Google and AppNexus, both of which are verifying and very pleased with our ads.txt.
How do you implement this?
We personally built a cloud-based hosting solution using Digital Ocean. Why? Because we represent hundreds of sites hosted on closed access platforms.
We needed something that could scale to hundreds of requests, support load balancing for redundancy, support free SSL certificates for secure sites on closed platforms, and, most importantly, something we could point A Records to.
That last one was a curveball thrown at us. The issue is that DNS records at the naked domain are limited to pointing to IP Addresses. While some DNS services such as DNSimple have workarounds using an ALIAS, we unfortunately can’t rely on that when dealing with thousands of publishers and hundreds of domain name providers.
Luckily, Digital Ocean offers an IP Address-based Load Balancer that we’re able to point the A Record to. That’s rare in Cloud-based hosting companies that also offer free SSL certificates (trust us, we looked around a lot).
If you’re a Mediavine publisher and you’re not currently running ads.txt because of a closed platform we previously didn’t offer a solution to, we will be reaching out soon.
Otherwise, please feel free to email firstname.lastname@example.org and we’ll get you running on our ads.txt hosting service.
To non-Mediavine publishers, we hope this workaround does the trick for you too!
© 2018 Mediavine. All Rights Reserved.