I recently had the chance to get a developer account for WP Engine, a dedicated WordPress hosting company, and test some advanced ad setups on their servers. This post contains my findings.

ads.txt not showing up

Advanced Ads creates a virtual ads.txt file. To work, the URL like yourdomain.com/ads.txt would need to be forwarded to WordPress. This is not happening automatically on WP Engine. They are happy to solve that for you, though.

Just reach out to the WP Engine support and ask them to add the following rule. Feel free to link to this instruction.

location ~* ^/ads.txt {
log_not_found off;
if_modified_since before;
add_header X-Type "ads";
add_header Cache-Control "public, max-age=2592000";
error_page 403 = @varnishforever;
error_page 404 = @varnishforever;
}

Please keep in mind that ads.txt only works on the root domain and not subdomains, so it would not be created on your .wpendine.com staging site. See the ads.txt manual for more information.

Groups not rotating – Allow ORDER by RAND()

The most peculiar setting I found in WP Engine was that they don’t allow random ads by default. This affects our rotating ad groups.

Solution: enable the Allow ORDER by RAND() option, which is located in your WordPress Dashboard > WP Engine > General Settings > Advanced Configuration.

HTTPS backend and HTTP frontend

While my WP Engine test site was using HTTP in the frontend, the admin interface used HTTPS only. This caused most ads not to show up because the cache-busting call to load them was failing.

Solution: go to the SSL section in your WP Engine admin dashboard and either get a free or premium SSL certificate for your frontend as well.

It looks like you can also just add HTTPS to the URLs of your sites in your WordPress Dashboard > Settings > General.

Display ads based on URL parameters

Our URL Parameter display condition allows you to show different ads based on the URL. E.g., you might want to show some ads only to users from a certain traffic source like https://example.com/my-post/?source=facebook.

WP Engine might block such parameters from showing different ads. As a solution, you can use our Cache-Busting or ask them to exclude certain parameters.

Please also read their article about UTM and GCLID variables and caching.

Cookies blocked

In the past, I have seen WP Engine block a lot of cookies by default. This also prevented some visitor conditions in Advanced Ads Pro from working.

I was not able to reproduce it with my account, so it might be resolved.

Anyway, if you have the feeling that some visitor conditions might not work then you might want to look into cookies – or let us know in support that you are using WP Engine, so that we take a look at that.

As a reference, they have a post about cookies and caching.

Any other issues with WP Engine and ads?

If you are using WP Engine and experience problems with your ads then please reach out. I will update this tutorial with any new information coming up.

Billing of Tracking calls

Depending on your package, WP Engine might bill you for tracking calls if you have an external cache enabled like Cloudflare. Please see the information under Other Notes.