<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: adPluga</title>
    <description>The latest articles on DEV Community by adPluga (@adpluga).</description>
    <link>https://dev.to/adpluga</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4152561%2F65e7e8c9-3e88-4388-940c-bc77c102f1f7.png</url>
      <title>DEV Community: adPluga</title>
      <link>https://dev.to/adpluga</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adpluga"/>
    <language>en</language>
    <item>
      <title>What a 4.4 KB ad tag does, and why the ad cannot touch your page</title>
      <dc:creator>adPluga</dc:creator>
      <pubDate>Sat, 03 Oct 2026 13:22:18 +0000</pubDate>
      <link>https://dev.to/adpluga/what-a-44-kb-ad-tag-does-and-why-the-ad-cannot-touch-your-page-24g5</link>
      <guid>https://dev.to/adpluga/what-a-44-kb-ad-tag-does-and-why-the-ad-cannot-touch-your-page-24g5</guid>
      <description>&lt;p&gt;Most ways of putting an ad on a website ask you to trust a lot of third-party JavaScript on your page. This post walks through a tag built the other way round: small, and unable to run code inside your page. I work on it, so take the enthusiasm with salt, but every claim below is checkable in the browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  The whole integration
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;async&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.adpluga.com/v1/tag.js"&lt;/span&gt;
        &lt;span class="na"&gt;data-adpluga-key=&lt;/span&gt;&lt;span class="s"&gt;"pk_test_kvhgusa3wauuklgogatyovhbohlpc"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;data-adpluga-slot=&lt;/span&gt;&lt;span class="s"&gt;"35490c85-1933-4764-bf04-647005ea6db5"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That key and slot are the public demo ones: they serve test ads, nothing is charged, nothing counts toward any quota. Paste both lines into an HTML file and open it. On WordPress the same two lines go into a Custom HTML block; in Google Tag Manager, into a Custom HTML tag.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Discovery
&lt;/h2&gt;

&lt;p&gt;The script reads its key from its own &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; element, then looks for every element with &lt;code&gt;data-adpluga-slot&lt;/code&gt;. A &lt;code&gt;MutationObserver&lt;/code&gt; keeps watching, so a slot rendered later by React, Vue or a router change is picked up without calling anything. If you need control, &lt;code&gt;window.AdPluga.refresh(el)&lt;/code&gt; re-fetches a slot and &lt;code&gt;window.AdPluga.destroy(el)&lt;/code&gt; tears one down.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. One request per slot
&lt;/h2&gt;

&lt;p&gt;Each slot makes one call to &lt;code&gt;/v1/serve&lt;/code&gt; on the edge host. The response carries the creative and a signed token. If there is no advertiser for that space, the response is still an ad: a house ad from adPluga, so the page never shows an empty box.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The sandbox
&lt;/h2&gt;

&lt;p&gt;The creative is rendered in an iframe with this attribute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;sandbox="allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is no &lt;code&gt;allow-scripts&lt;/code&gt; and no &lt;code&gt;allow-same-origin&lt;/code&gt;. The ad cannot execute JavaScript, cannot read your cookies or storage, and cannot reach into your DOM. A click can still open the advertiser's page, but only because the user clicked. &lt;code&gt;referrerpolicy="no-referrer"&lt;/code&gt; keeps your URLs out of the advertiser's logs.&lt;/p&gt;

&lt;p&gt;The trade-off is that the creative cannot be interactive in the JavaScript sense. Carousel ads, for example, are built with CSS scroll-snap only. That cost about half a kilobyte and kept the tag at 4.4 KB gzipped.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Counting only what was seen
&lt;/h2&gt;

&lt;p&gt;The tag reports an impression as viewable only when at least 50% of the ad was on screen for at least one second, the IAB definition. An ad that loaded at the bottom of a page nobody scrolled to is not reported as seen.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Test and live
&lt;/h2&gt;

&lt;p&gt;The key prefix decides the mode: &lt;code&gt;pk_test_&lt;/code&gt; serves real test creatives with no billing, &lt;code&gt;pk_live_&lt;/code&gt; is the real thing and needs the site to be verified first (DNS record, meta tag or a file at the root).&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it without an account
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://adpluga.com/en/devs/playground/" rel="noopener noreferrer"&gt;playground&lt;/a&gt; has the demo key filled in. Press Render and watch the network tab: one serve call, one iframe, and the tracking call once the ad is in view.&lt;/p&gt;

&lt;p&gt;A runnable copy of the HTML above is in &lt;a href="https://github.com/adpluga/examples/tree/main/html" rel="noopener noreferrer"&gt;github.com/adpluga/examples&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>html</category>
    </item>
    <item>
      <title>How to add ads to a Flutter app in 5 minutes</title>
      <dc:creator>adPluga</dc:creator>
      <pubDate>Wed, 30 Sep 2026 22:51:24 +0000</pubDate>
      <link>https://dev.to/adpluga/how-to-add-ads-to-a-flutter-app-in-5-minutes-5d70</link>
      <guid>https://dev.to/adpluga/how-to-add-ads-to-a-flutter-app-in-5-minutes-5d70</guid>
      <description>&lt;p&gt;This guide shows how to get an ad showing in a Flutter app, first in test mode and then for real. You do not need a billing account or a card to reach the end.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you need
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A Flutter 3.10 or newer app (Dart 3).&lt;/li&gt;
&lt;li&gt;A free adPluga account.&lt;/li&gt;
&lt;li&gt;Two minutes in the dashboard to create the key and the space.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  1. Create the key and the space in the dashboard
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Under &lt;strong&gt;Properties&lt;/strong&gt;, create the property for your app.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Slots&lt;/strong&gt;, create a space, for example a 320×50 banner at the bottom of the screen. Keep the slot id.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Integration&lt;/strong&gt;, copy the publishable test key. It starts with &lt;code&gt;pk_test_&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The test key shows real ads in your app, but nothing is charged, nothing is paid and nothing counts toward the quota.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Install the SDK
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flutter pub add adpluga_flutter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The package works on Android and iOS.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Initialise once
&lt;/h2&gt;

&lt;p&gt;Do it when the app starts, before showing any ad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:adpluga_flutter/adpluga_flutter.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;Future&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kd"&gt;async&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;WidgetsFlutterBinding&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ensureInitialized&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;AdPluga&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;publisherKey:&lt;/span&gt; &lt;span class="s"&gt;'pk_test_...'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;runApp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;MyApp&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Show a banner
&lt;/h2&gt;

&lt;p&gt;The banner is a widget like any other. Put it where you want the ad to show:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;AdPlugaBanner&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;slotId:&lt;/span&gt; &lt;span class="s"&gt;'your-slot-id'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;onImpression:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
  &lt;span class="nl"&gt;onClick:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
  &lt;span class="nl"&gt;onError:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When there are no advertisers for that space yet, an adPluga ad shows instead. The space is never empty.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Show an interstitial
&lt;/h2&gt;

&lt;p&gt;An interstitial fills the whole screen between two moments of the app, for example at the end of a level:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;ad&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;InterstitialAd&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;slotId:&lt;/span&gt; &lt;span class="s"&gt;'your-interstitial-slot-id'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;ad&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;show&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The SDK also has native, rewarded and carousel formats.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Go live
&lt;/h2&gt;

&lt;p&gt;When everything works in test, swap &lt;code&gt;pk_test_&lt;/code&gt; for &lt;code&gt;pk_live_&lt;/code&gt;. To use the live key, first confirm in the dashboard that the property is yours. We do not ask for a card for that: the free plan serves live up to &lt;strong&gt;100,000 decisions a month&lt;/strong&gt;, and a decision is each ad request the app makes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Already using AdMob?
&lt;/h2&gt;

&lt;p&gt;You do not have to remove it. Under &lt;strong&gt;Mediation&lt;/strong&gt; in the dashboard, add AdMob and other networks (Meta, InMobi, Unity, Liftoff) and let them compete for the same space with adPluga. The best offer wins each time. The &lt;a href="https://adpluga.com/en/admob-alternative/" rel="noopener noreferrer"&gt;AdMob alternative&lt;/a&gt; page explains how.&lt;/p&gt;

&lt;p&gt;The full SDK reference is at &lt;a href="https://adpluga.com/en/devs/sdks/" rel="noopener noreferrer"&gt;SDKs&lt;/a&gt; and the shortest path at &lt;a href="https://adpluga.com/en/devs/quickstart/" rel="noopener noreferrer"&gt;Quickstart&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I work on adPluga. A complete Flutter example app is at &lt;a href="https://github.com/adpluga/examples/tree/main/flutter" rel="noopener noreferrer"&gt;github.com/adpluga/examples&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>mobile</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
