WP Engine and ads
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
Contents
Please keep in mind that the ads.txt file needs to be placed in 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.
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.
301 redirect on AMP pages
We saw a 301 redirect of our tracking call on AMP pages.
To our inquiry, the WP Engine support replied as following:
The 301 should pose no issue as it appears the final request ends up being a 200. I suspect the 301 is showing here due to the security header ‘add_header Strict-Transport-Security “max-age=63072000; includeSubDomains; preload”;’ being used here, and pulling it off of the CDN just from looking into things here.
Billing of Tracking calls
By default, WP Engine does only bill a single visit per individual IP address per day. See their definition of a billable visit. So when a visitor comes to a page that also uses the local AJAX-based tracking method in Advanced Ads Tracking, the additional request is not creating more costs.
However, you might receive a higher bill than expected if you have an external cache enabled like Cloudflare. While all page traffic going through Cloudflare practically uses a single IP address and so is only billed as a single request, each tracking call might count as an individual visit since it is technically sent from the visitor’s IP address. For more details please see the information under Other Notes.
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.
Starting in 2009, Thomas’ own word game website grew to 40 MM page impressions per month. He then built Advanced Ads to help his colleagues to place ads and test different ad positions and networks tests without any coding skills. Thomas now enjoys improving the product for our more than 150,000 users worldwide.