Enable Header Bidding Advertising in a WordPress Site

WordPress child theme is a powerful way to add header bidding advertising capability to a WordPress site. This blog discusses how to enable header bidding advertising in a WordPress site. More specifically, it describes how to integrate Prebid.js and Google Ad Manager with WordPress site.

To create a child theme, you create a folder first. In the folder, add a file named style.css and ensure the Template property has the same value as your primary theme name. For example, the style.css for theme Twenty Twenty-Four looks as follows.

/**
 * Theme Name: AdRelevantis
 * Template:   twentytwentyfour
 * ...other header fields
 */

If you want to put an ad in a template part, say header.html, you need to create a parts subfolder and add a header.html file there. In the header.html file, add code like

<!-- wp:group {"align":"wide","layout":{"type":"flex","justifyContent":"space-between","flexWrap":"wrap"}} -->
<div id="div-adrhorizontal" class="wp-block-group alignwide">
</div>
<!-- /wp:group -->

You need to also add a functions.php file in the child theme folder. In the functions.php file, you add an action as follows.

add_action( 'wp_enqueue_scripts', 'themeslug_enqueue_script' );

where the function ‘themeslug_enqueue_script’ loads Prebid.js and Google Ad Manager libraries and creates ad units for your site. Please refer to the open source project wpchildthemesADR for details.

In the functions.php file, you add a filter as follows:

add_filter('the_content', 'add_incontent_adr');

where the function ‘add_incontent_adr’ adds ads in content. Please refer to the open source project wpchildthemesADR for details.

This gives you a starting point to display header bidding ads in your WordPress site. There are various ways to make changes to adapt to your situations. For example, you can use your own Google Ad Manager tags, create different ad units and change ad positions in a page, or even use different header bidding libraries.

Any questions or need more information? Contact us info@adrelevantis.com.

Is Content-Driven Advertising Right For You?

Content-Driven Advertising is a change of mindset. Publishers need to decide if they want to display ads relevant to their content while advertisers need to decide if they want to target ads to specific content categories or/and keywords.

The FAQ helps you decide if the Content-Driven Advertising is for you. We would like to hear from you about your decision. You can reach us at info@adrelevantis.com.

Attention Metrics, Content-Relevant Ads and Content-Driven Advertising

Attention metrics calculate the likelihood of attention paid to any given ad placement. The underlying intention is to allow advertisers an apples-to-apples comparison of how their media is performing across different channels in a fragmented digital ecosystem.

According to Sandee LaMotte, the average attention on screen has decreased by 69% since 2004. Content and ads compete for our focus, making attention a main currency of the digital age. There is an issue among publishers, advertisers and audiences. Audiences are interested in and focus on the content; advertisers try to pull their attention to the ads.

How to address this dilemma, then? The answer is content-relevant ads. While audiences consume the content, ads that are relevant to the content are displayed.

Content-Driven Advertising is a technology developed by AdRelevantis that displays content-relevant ads. By providing page content (IAB Categories and ranked keywords) as First Party Data (FPD), advertisers can target ads to the IAB Categories and the keywords. The matched ads are sent for bid with a higher bid price.

Content-Driven Advertising is also a change of mindset on both publishers and advertisers. Publishers can choose to send content’s IAB Categories and ranked keywords as FPD to ad exchanges if they want to display ads relevant to the content. On the other side, advertisers can choose what IAB Categories or keywords their ads are targeted to.

Content-Driven Advertising has been integrated with Prebid and Google Ad Manager. To see how the Content-Driven Advertising solution works with a publisher page, please go to Content-Driven Native Ads with Google Ad Manager – Part 2.

Any questions? Drop us a line at info@adrelevantis.com.