โก Quick Start
Get ads running on your site in 3 steps:
1
Register Your Site
Call our registration API with your site details. You'll get a unique site token and slug.
2
Add the Script Tag
Drop one <script> tag into your HTML. That's it โ the SDK handles the rest.
3
Place Ad Slots
Add data-squibla-slot divs wherever you want ads. They fill automatically.
1. Register Your Site
Make a single API call to register your site with Squibla. You'll receive credentials that the SDK uses to authenticate.
curl
curl -X POST https://squibla.com/v1/sdk/register-site \
-H "Content-Type: application/json" \
-d '{
"site_name": "My News Site",
"site_url": "https://mynewssite.com",
"contact_email": "publisher@mynewssite.com",
"categories": ["news", "technology", "sports"]
}'
Response:
json
{
"site_id": 42,
"site_slug": "mynewssite",
"site_token": "eyJhbGciOiJIUzI1NiIs...",
"api_key": "sk_live_abc123...",
"default_spaces": [
{"slot": "header_banner", "dims": "728x90"},
{"slot": "sidebar_top", "dims": "300x250"},
{"slot": "sidebar_bottom", "dims": "300x250"},
{"slot": "footer_banner", "dims": "728x90"}
]
}
Save your site_token and site_slug โ you'll need them in the next step.
2. Add the Script Tag
Paste this into your HTML <head> or before </body>. Use the credentials from Step 1:
html
<script
src="https://squibla.com/v1/sdk/sdk.js"
data-site-token="YOUR_SITE_TOKEN"
data-site-slug="YOUR_SITE_SLUG"
defer
></script>
Article Pages
On article/content pages, add article metadata so Squibla can create per-article ad placements that advertisers can bid on individually:
html
<script
src="https://squibla.com/v1/sdk/sdk.js"
data-site-token="YOUR_SITE_TOKEN"
data-site-slug="YOUR_SITE_SLUG"
data-article-id="article-123"
data-article-url="https://mynewssite.com/article/123"
data-article-title="Breaking: Major Tech Merger Announced"
data-article-category="technology"
defer
></script>
The SDK will automatically register 4 article-specific ad spaces the first time a user visits. These become unique biddable placements in the Squibla marketplace.
3. Place Ad Slots
Add empty <div> elements with data-squibla-slot wherever you want ads to appear. The SDK fills them automatically:
html
<div data-squibla-slot="header_banner"></div>
<div data-squibla-slot="sidebar_top"></div>
<div data-squibla-slot="article_top"></div>
<div data-squibla-slot="article_inline"></div>
<div data-squibla-slot="article_bottom"></div>
<div data-squibla-slot="footer_banner"></div>
Available Slot Types
| Slot Name | Recommended Size | Where to Place |
header_banner | 728ร90 | Top of page, below navigation |
sidebar_top | 300ร250 | Top of sidebar |
sidebar_bottom | 300ร250 | Bottom of sidebar |
footer_banner | 728ร90 | Above footer |
article_top | 728ร90 | Before article content |
article_inline | 300ร250 | Between paragraphs |
article_sidebar | 300ร250 | Article page sidebar |
article_bottom | 728ร90 | After article content |
Slots with no active ad simply stay hidden โ no broken layouts.
How It Works
โ
Page Loads
SDK reads your site token and discovers all ad slot elements on the page.
โ
Auto-Register
On article pages, the SDK auto-creates unique biddable ad spaces for that specific article.
โ
Fetch Ads
SDK requests winning ads from Squibla. Article-specific ads take priority, with site-wide fallback.
โ
Track & Earn
Impressions tracked when 50% visible. Clicks tracked + redirected. Revenue accrues to your account.
๐ฐ Revenue Model
Advertisers bid on your ad spaces in Squibla's marketplace. When a bid wins and an ad is placed:
- First placement: 80/20 split (you keep 80%)
- Renewals: 90/10 split (you keep 90%)
- Payouts: TRON (TRX) to your wallet โ connect it in your publisher dashboard
Full Example
Here's a complete article page with all Squibla ad slots:
html
<!DOCTYPE html>
<html>
<head>
<title>My Article</title>
<script
src="https://squibla.com/v1/sdk/sdk.js"
data-site-token="eyJhbG..."
data-site-slug="mynewssite"
data-article-id="post-456"
data-article-title="AI Breakthrough in Healthcare"
data-article-category="technology"
defer></script>
</head>
<body>
<div data-squibla-slot="header_banner"></div>
<main>
<div data-squibla-slot="article_top"></div>
<article>
<h1>AI Breakthrough in Healthcare</h1>
<p>First few paragraphs...</p>
<div data-squibla-slot="article_inline"></div>
<p>More content...</p>
</article>
<div data-squibla-slot="article_bottom"></div>
</main>
<aside>
<div data-squibla-slot="sidebar_top"></div>
</aside>
<div data-squibla-slot="footer_banner"></div>
</body>
</html>
API Reference
All endpoints are at https://squibla.com/v1/sdk/
POST
/v1/sdk/register-site
Register a new publisher site. Returns site_token, site_slug, and default ad spaces.
POST
/v1/sdk/register-article
Auto-register ad spaces for a specific article. Requires X-Squibla-Token header. Idempotent.
GET
/v1/sdk/ads/{site_slug}/{slot}?article_id=X
Fetch the winning ad for a slot. Returns ad HTML, campaign ID, and tracking URLs. Article-specific slots checked first, then site-wide fallback.
POST
/v1/sdk/impression
Record an ad impression. Triggered automatically by the SDK when an ad is 50% visible in viewport.
POST
/v1/sdk/click/{campaign_id}
Record a click and get the redirect URL. Handled automatically by the SDK.
GET
/v1/sdk/sdk.js
The SDK JavaScript file. Embed this on your pages.
JavaScript API
The SDK exposes window.Squibla for advanced control:
javascript
await window.Squibla.fillSlots();
window.Squibla.config.articleId = 'new-article-789';
window.Squibla.config.articleTitle = 'New Article Title';
window.Squibla.config.articleCategory = 'sports';
await window.Squibla.registerArticle();
await window.Squibla.fillSlots();
window.Squibla.resetSlots();
window.Squibla.updateConfig({ articleId: '456' });
SPA / React / Vue Support
For single-page applications, call the SDK methods on route changes:
react
import { useEffect } from 'react';
function ArticlePage({ article }) {
useEffect(() => {
if (window.Squibla) {
window.Squibla.config.articleId = article.id;
window.Squibla.config.articleTitle = article.title;
window.Squibla.config.articleCategory = article.category;
window.Squibla.registerArticle()
.then(() => window.Squibla.fillSlots());
}
return () => window.Squibla?.resetSlots();
}, [article.id]);
return (
<div>
<div data-squibla-slot="article_top" />
<h1>{article.title}</h1>
<p>{article.content}</p>
<div data-squibla-slot="article_bottom" />
</div>
);
}
FAQ
What if no ads are available for a slot?
The slot stays hidden (display: none). Your layout won't break.
How are per-article ads different from site-wide ads?
Per-article ads are tied to a specific piece of content. Advertisers can bid on viral articles individually, paying premium rates for high-traffic content. Site-wide ads are fallbacks shown when no article-specific ad is available.
How do I get paid?
Connect your TRON wallet in the Publisher Dashboard. Payouts are processed in TRX when your balance reaches the minimum threshold.
Is the SDK async? Will it slow down my site?
Yes, fully async. The defer attribute ensures it loads after your page content. Ads fill in without blocking rendering.
Can I use custom slot names?
Yes! Use any name in data-squibla-slot. The SDK will request it from Squibla. Standard names (header_banner, sidebar_top, etc.) are pre-registered for your site โ custom names work too but won't have pre-created ad spaces.
Ready to monetize?
Register your site, drop in the SDK, and start earning from your traffic.
Get Started โ