Configure Yahoo-Bing contextual advertising
This integration uses PLACEHOLDER VALUES. You must sign up for Media.net and replace the placeholder Config ID with your actual account credentials.
Media.net is a leading contextual ad network powered by Yahoo and Bing. It's often considered the second-best alternative to Google AdSense:
Visit media.net/#publisher-apply and complete the application. You'll need:
Media.net typically reviews applications within 2-7 business days. They may reach out for additional verification.
Once approved, access your dashboard at media.net to create ad placements.
Your Config ID (also called Configuration ID) is found in your dashboard under each ad placement. It looks like: YOUR_MEDIA_NET_CONFIG_ID
Place this script in your <head> section:
<!-- Media.net Contextual Ads Script - PLACEHOLDER -->
<script type="text/javascript">
var contextid = 'YOUR_MEDIA_NET_CONFIG_ID';
</script>
<script type="text/javascript" src="//contextual.media.net/main.js?cookieAcceptance=1"></script>
<!-- Media.net Display Ad - 728x90 - PLACEHOLDER -->
<div id="mnnative_display_ad" style="display:none">
<noscript><em>Ads are not supported for your browser at this time.</em></noscript>
</div>
<script type="text/javascript">
var width = window.innerWidth || document.documentElement.clientWidth;
if (width >= 728 ) {
nmn广告.width = '728';
nmn广告.height = '90';
nmn广告.slot = '#mnnative_display_ad';
nmn广告.execute();
}
</script>
<!-- Media.net Native Ad - PLACEHOLDER -->
<div id="mnnative_native_ad">
<noscript><em>Ads are not supported for your browser at this time.</em></noscript>
</div>
<script type="text/javascript">
var width = window.innerWidth || document.documentElement.clientWidth;
if (width >= 300) {
nmnads.width = '300';
nmnads.height = '250';
nmnads.slot = '#mnnative_native_ad';
nmnads.execute();
}
</script>
| Component | Placement | In index.html |
|---|---|---|
| Script Tag | Head section | After other ad scripts |
| Display Ad | Where ad displays | Replace .ad-container |
| Native Ad | In-feed or sidebar | Dedicated slots |
Native ads blend seamlessly with your content and appear as sponsored content:
Note: Native ads include "Ad" or "Sponsored" labels for transparency.
Here's how the Media.net placeholder currently appears in index.html:
<!-- ============================================ -->
<!-- MEDIA.NET PLACEHOLDER - REPLACE WHEN SIGNED UP -->
<!-- ============================================ -->
<!-- Media.net Script -->
<script>
var contextid = 'YOUR_MEDIA_NET_CONFIG_ID';
</script>
<script> src="//contextual.media.net/main.js?cookieAcceptance=1"></script>
<!-- Media.net Ad Placeholder -->
<div class="ad-container">
<div class="ad-label">Advertisement</div>
<div style="background: #e8f5e9; min-height: 90px; display: flex; align-items: center; justify-content: center; border-radius: 4px; color: #48bb78;">
Media.net Ad - Replace with your code
</div>
</div>
Once you receive your Media.net credentials:
YOUR_MEDIA_NET_CONFIG_ID with your Config ID from dashboard