Adding your own placement
Discover how to add custom placements to Advanced Ads using action hooks. This step-by-step guide helps you create tailored ad displays for your WordPress site.
Discover how to add custom placements to Advanced Ads using action hooks. This step-by-step guide helps you create tailored ad displays for your WordPress site.
If you are using an image inside a group attached to a popup or sticky placement the size of the image could be smaller on mobile devices compared to the same image which is not inside a group. You can fix this by adding custom CSS to your popup or sticky placement wrapper .PREFIX-layer { … Read more
How to extend the URL Parameters display condition to work also on the domain of the page.
By default, Google Ad Manager comes with head and body codes. Matching them across different pages is often a challenge, as you can see in How to insert Google Ad Manager ads into WordPress. Our Google Ad Manager WordPress plugin manages that automatically. We recommend that you use the plugin instead of the manual code … Read more
The following code snippet will hide the ad label in case that the ad placement stays empty. You can implement this snippet into the custom code field of a particular ad.
How to add `data-pagespeed-no-defer` to script files loaded in WordPress to prevent them from being deferred.
Advanced Ads Tracking can attach the visited URL’s query parameters to the target URL of the ad. You need to enable this feature through a filter hook before you can use it. Since Tracking 2.0, this feature only works with link cloaking enabled. Example If your target URL setting also contains parameters, they merge with … Read more
How to make the Advanced Ads ad post type public to reach them under dedicated URLs.
Discover how to respond to changes in ad status using Advanced Ads action hooks. From publishing to expiration, these code examples give you control.
How to trigger the reload of ads in the frontend.
How to disable the Ad Settings meta box using some custom code.
How to show an alternative ad if AdSense or Google Ad Manager ads stay blank?
Advanced examples for ad server embed codes for our Wordpress ad server module.
Explains how to use the advanced-ads-content-injection-nodes-without-ads filter to exclude certain elements from ad injection.
Code examples on how to move the output of the Custom Code option above the ad or how to manipulate it on the fly.
By default, Advanced Ads sets the available ad weight for ads in groups to 10. This number increases if the amount of ads in the group is higher. You can also add your own ad weight maximum using the code below. /** * Increase available ad weight in group settings * uses 100 if regular … Read more
Advanced Ads comes with “Ad Groups” as the primary taxonomy for categorizing ads. However, if your needs extend beyond this default setup and you require additional options for ad grouping, you can leverage the provided code as a solid foundation.
Some users might want to change the div container Advanced Ads uses for ad placeholders in Advanced Ads Pro Cache Busting or when some output options like a margin are selected. The code below changes the div into an article container. Please notice that this could break some other parts of Advanced Ads, especially JavaScript-based ad … Read more
If you are using our advanced JavaScript functions to retrieve or store cookies on a website that loads the jQuery library in the footer, you might be interested in the following code snippets. The first part is an example of how to show the number of page impressions from the appropriate cookie. The second snippet shows … Read more
Advanced Ads automatically removes custom meta boxes on the ad edit screen. This is needed, because sometimes, plugin authors forgot to specify that their meta box is only meant for public post types, like posts and pages. Users then might have seen an SEO-related box on the ad pages, which neither worked nor made sense. … Read more
The following code allows you to block specific user agents or referrers from being tracked with the Tracking add-on. It was written for a very specific use case in mind but can still serve you as a basis to implement your own, custom filter.
The following JavaScript code allows you to do something as soon as Advanced Ads Pro finished loading ads. if ( typeof advanced_ads_pro === ‘object’ ) { advanced_ads_pro.observers.add(function(event) { // Note: These events may be triggered multiple times // because not all ads are injected at the same time. // The injection may be delayed by … Read more
Advanced Ads Pro comes with passive Cache Busting, a performance-optimized method to deliver ads on cached websites. It basically performs the checks needed to choose the correct ad for a visitor using JavaScript. This includes most Visitor Conditions. While extending Visitor Conditions with PHP-based checks is rather simple by just looking at the basic code, … Read more
Increase your ad management skills without spending more time.
Join over 150,000 publishers and AdOpts increasing their ad revenue.