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.

Fix: Different size of Popup images on mobile

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

Creating Inline Tags for Google Ad Manager

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

Inherit query parameter

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 react to ad status changes

Discover how to respond to changes in ad status using Advanced Ads action hooks. From publishing to expiration, these code examples give you control.

Increase available ad weight in groups

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

Add a taxonomy for ads

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.

Change div container to another HTML element

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

Using the advads JavaScript library after jQuery is available

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

Allow custom meta boxes on ad edit screen

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

Block specific user agents and referrers from being tracked

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.

JavaScript event when ads are loaded using Advanced Ads Pro

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

Extending Visitor Conditions and passive Cache Busting

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

Make it better

Increase your ad management skills without spending more time.
Join over 150,000 publishers and AdOpts increasing their ad revenue.