سجل التغييرات
QiSuite Web SDK
كل تغيير على سكربت التضمين qiads.js وعلى ما يتفق عليه مع الخادم (الخصائص والأحداث والدوال وحقول الإرسال). الإصدارات تتبع SemVer: الإصدار الرئيسي وحده يزيل أو يغيّر، والفرعي يضيف، والتصحيح يصلح. /qiads.js يتبع أحدث 1.x، وكل إصدار مثبّت /sdk/<version>/qiads.js (حيث version رقم الإصدار) يبقى منشوراً. السجل بالإنجليزية، على طريقة Keep a Changelog.
Every change to the embed tag qiads.js and to what it agrees on with the server (attributes, events, methods, beacon fields). Versions follow Semantic Versioning: only a major release removes or changes, a minor release adds, a patch fixes. /qiads.js follows the latest 1.x; every pinned /sdk/<version>/qiads.js stays published. The format follows Keep a Changelog.
Server — 2026-11-26
No release of the tag: a change on the server's side of what the two agree on.
Changed
POST /api/ads/track: aclickevent for a creative without a link is not counted. A creative served withclick_href: nullhas no link — the advertiser chose to send the ad without one, or none is on file — and is drawn as a non-link; aclickevent for it is now filed asnot_navigation, in version 1 and version 2 beacons alike. No release of the tag sends one. A native integration that sentclickfor such a creative should stop. A creative with a link is counted as before: by the redirect, and by the version 1clickbeacon of a tag older than 1.3.
[1.3.2] — 2026-10-31
Security
- The configuration comes only from the partner. The API origin (where ads are fetched from, which click links are trusted, where beacons go), the channel, the language, the popup and the test and debug switches are read only from the SDK's own
<script>tag and from awindow.qiadsConfigthe page set to a plain object (an object literal, orObject.create(null)). Markup on the page no longer stands in for either: an element namedcurrentScript(<img name="currentScript" data-host="…">) is not taken for the tag, and elements withid="qiadsConfig"(one, several, or a form with named fields) are not taken for the configuration. - Nothing inherited counts. The tag's
data-*attributes are read withgetAttribute, andwindow.qiadsConfigkeys only as its own properties of the expected type (host,siteandlangstrings,onClicka function), so a value added toObject.prototypebefore the tag runs changes nothing. - The tag is the running
<script>, whatever its file is called (a copy hosted or bundled under another name keeps itsdata-*attributes), or an injected copy with nosrc. An element standing in fordocument.currentScriptis never a<script>. Only an engine that does not report the running script falls back to the last tag whosesrcends inqiads.jsorqiads.min.js. window.qiadsConfigcounts only when the page set it onwindowitself (window.qiadsConfig = {…}or a top-levelvar): aqiadsConfigthat reaches the window throughObject.prototype(a polluted prototype or a__proto__merge) or an element with that id is not configuration.- A copy already running is recognised by its own API on
window(its own__loadedmarker andinit), so an element namedQiAdsor a polluted__loadedcannot stop the SDK from starting. - The second copy of the tag (the popup snippet next to the universal one) lends its
data-site,data-langanddata-popuponly when it is itself the running tag. - Pinned copies of earlier releases (
/sdk/1.3.1/,/sdk/1.3.0/,/sdk/1.2.1/) are immutable and keep their reading; the evergreen/qiads.jshas this release, and a pinned snippet gets it by moving to/sdk/1.3.2/qiads.jswith its new hash.
Fixed
testanddebuginwindow.qiadsConfigread a string as the tag's attributes do:"0","false","no"and"off"leave the mode off (any non-empty string turned it on before).true,falseand numbers behave as before.
[1.3.1] — 2026-10-12
Fixed
- Rotating banner: pressing play with a mouse now resumes the rotation as soon as the pointer leaves the banner. The button's icon is changed in place instead of being replaced under the pointer, which in Chromium cost the banner its
pointerleave, so it stayed paused as if still hovered.
[1.3.0] — 2026-10-09
The measurement release: the tag now reports what the IAB/MRC guidelines count (ad requests and fill, rendered and viewable impressions, server-side clicks), gives host apps a click and lifecycle contract for WebViews, and ships as an immutable, SRI-pinnable file. Every 1.2.1 snippet keeps working unchanged.
Added
- Events.
QiAds.on(type, fn)/QiAds.off(type, fn)and bubbling DOM events on the slot:qiads:request,qiads:render,qiads:empty,qiads:error,qiads:impression,qiads:click,qiads:close. One detail object for both:{type, placement, creative: {id, booking_id, lang}, impressionId, url, landing, slot, reason}. - Click handoff.
qiads:clickis cancelable (event.preventDefault(),detail.preventDefault(), returningfalsefrom a listener or fromonClickinQiAds.init/window.qiadsConfig): the host app opensdetail.urlin Custom Tabs or SFSafariViewController and the click is still counted. - Methods.
QiAds.refresh(target?)(a new slot instance: new impression ids, fresh ads),QiAds.setVisible(visible)(the host's own visibility, e.g. a native screen covering the WebView),QiAds.getSlots(),QiAds.getVersion(), and the GPT-style queueQiAds.cmdbesidewindow.qiads. - Test mode (
data-test,?qiads_test=1,QiAds.init({test: true})): renders normally, beacons carrytest:1and click linkst=1, nothing is counted. - Debug mode (
data-debug,?qiads_debug=1,QiAds.init({debug: true})):console.infodiagnostics, outlined ads, and the server'sX-QiAds-Resultverdict for every beacon. - Slot attributes:
data-aspect(reserve the box while loading, with apadding-topfallback where CSSaspect-ratiois missing),data-collapse(autoornever),data-page(a logical page name). Prefixed aliases for every slot attribute exceptdata-qiadsanddata-lang:data-qiads-format,data-qiads-limit,data-qiads-rotate,data-qiads-target,data-qiads-fallback,data-qiads-dir,data-qiads-cap,data-qiads-aspect,data-qiads-collapse,data-qiads-page. - Script attributes:
data-test,data-debug,data-observe(fill[data-qiads]elements added later),data-page. - Measurement: ad requests (
request, with the number of creatives returned) and rendered impressions (render, with the creative's size andmb:1when viewability can be measured) as aggregate counters; the SDK honours the server'smeasuredirective, so they can be paused without a new release. - Rotating banner: a visible pause/play button (WCAG 2.2.2), touch swipe that follows the language's direction, carousel semantics (
aria-roledescriptioncarousel/slide, live region off while rotating), targets of at least 24×24 px. - Delivery:
/sdk/1.3.0/qiads.js(immutable, cached a year, SRI-pinnable, with a source map) next to the evergreen/qiads.js(5 minutes, revalidated in the background);/sdk/1.2.1/qiads.jsis the previous release, unchanged, for rollback. Every request carries the SDK version (sv).
Changed
- Clicks are counted by the server. An ad's link is now the signed click redirect
click_href(/api/ads/click/<token>): the click is counted as the user is redirected — whichever way the link is opened (new tab, long-press, host app) — and only real redirects count. Creatives withoutclick_href(an older server) keep the 1.2.1 beacon click. - Beacon v2: one batched
POST /api/ads/track({v:2, sv, site, page, ref, pv, now, events:[…]}) flushed within a second, on page hide, split at 3.5 KB and 20 events. Debug and test mode send it withfetchandkeepaliveso the response header can be read; otherwisesendBeaconas before. - Impression ids: one impression = one slot instance × one creative. Rotation coming back to the same creative counts nothing new; a refresh (SPA navigation,
QiAds.refresh, 30 minutes hidden, a new Baghdad day) is a new impression — returning to a long-lived home screen now counts again. - Viewability hardening: counting starts after the slide's fade-in; a zero-area slot,
visibility:hiddenoropacity:0never counts; the fallback poll withoutIntersectionObserverruns every 100 ms (was 250 ms);QiAds.setVisible(false)stops the timers. A render carriesmb:1(measured) only whereIntersectionObserveris available, or the poll runs in the top-level window: inside a cross-origin frame the poll cannot see the visitor's screen. - Automation on clicks: a click link carries
wd=1whennavigator.webdriveris true, as the beacons carrywd:1, so the redirect files it as automation. - Data minimisation: the page is reported as origin + path (no query string, no fragment) or a logical
data-page; the referrer as its origin only. - Images: the visible slide loads eagerly with high priority; the others lazily.
- Pausing: a touch tap no longer freezes rotation for the rest of the visit; keyboard focus (
:focus-visible) and a mouse hover still pause it. With "reduce motion" the banner keeps rotating, without the cross-fade. - Kurdish content is tagged
ckb(wasku); the «Ad» badge is at least 11 px. - Build: the SDK is written as modules in
sdk/srcand bundled (ES5, minified, ASCII).
Deprecated
data-popupon the script tag: still honoured, but popups belong at natural transition points, opened by the host withQiAds.popup/qiads.push(["popup", …])— never on app open.creatives[].booking_idin the serve answer: unused since 1.3; removed in 2.0.
Fixed
- Clicks from a script (
el.click(),isTrustedfalse) no longer navigate or count. - A WebView resumed hours later no longer files yesterday's queued events under today (events older than 15 minutes when sent are dropped).
- The space below a slot no longer jumps when the ad arrives (
data-aspect,style="aspect-ratio:…"). :focus-visibleandMediaQueryList.addEventListenerare feature-tested, so old WebViews (iOS before 15.4, WebView before 86) no longer throw.
Security
- The click destination always comes from the database, never from the link: the redirect cannot be used as an open redirect, answers with
Referrer-Policy: strict-origin-when-cross-origin, and stops working for cancelled or rejected bookings. - In-app guidance: never
data-target="_self"(the advertiser's page would load next to the app's JavaScript bridge); hand clicks to the app instead.
[1.2.1] — 2026-10-08
Changed
- A banner rotates through up to 7 creatives by default (was 3), the 7 campaigns a day the SuperQi slider sells. (A behaviour change released as a patch; under the policy above it would have been a minor release.)
[1.2.0] — 2026-09-23
Added
- Languages:
data-langon the script tag or the slot (ar,en,ku, else<html lang>, else Arabic), with the fallback rule (a campaign without a translation shows its Arabic creative),data-dir, anddata-qiads-langwritten with the language actually shown.
[1.1.0] — 2026-09-23
Changed
- Each ad renders in Shadow DOM; fair rotation between advertisers sharing a placement; impressions only after the image loads, in a visible tab.
Fixed
- Beacons are sent as
text/plain: the JSON type needed a CORS preflight the wildcard answer could not pass, and Chrome dropped partner beacons silently. - The popup frequency cap works without DOM storage (Android WebView); leak, timeout, old-browser and prototype-pollution fixes.
[1.0.0] — 2026-09-21
Added
- First release:
<script src="/qiads.js">withdata-site,data-host,data-popup,data-cap,data-rotate;[data-qiads]slots in three formats (banner,inline,popup); viewable impressions (50% for one second) and clicks sent withsendBeacon;QiAds.init,render,popup,close,destroyand thewindow.qiadscommand queue.