To test an ad tag in an HTML sandbox, paste the tag into a full HTML document and let the preview render it live in your browser. Code Playground opens with a small sample page in an editor and a live preview beside it, so you can drop in an ad tag, watch it draw, and read any script errors underneath — no install, no upload, no separate build step.
This guide covers the whole loop: writing the container page, pasting the tag, checking that it renders, filling in ad-server placeholders so the creative shows real values, and reading the console when it does not.
What an HTML sandbox actually gives you
A sandbox is a single HTML document rendered in a real browser engine. For ad work that matters, because most ad tags are JavaScript that writes an iframe into the page. If the tag never loads, the iframe never appears, and you see nothing. A sandbox shows you the difference between 'the tag is broken' and 'the creative is broken'.
Code Playground keeps everything in one document, index.html. CSS goes in a style tag, JavaScript in a script tag. There are no separate CSS or JavaScript panes and no second file, which is exactly what you want here: an ad tag expects a normal page context, not a fragment.
How to test an ad tag in an HTML sandbox
- Open Code Playground. It starts on a code editor holding a small sample page, with the live preview beside it. On a phone the two are shown one at a time, with 'Code' and 'Preview' buttons to switch.
- Replace the sample with your container page. Type or paste a minimal document:
<!DOCTYPE html>, ahead, and abodywith adivwhere the ad should land. Give that div an id you can target, such asad-slot. - Paste your ad tag inside the body, after the slot div. Most tags arrive as a
scriptblock plus a small inline snippet that calls the ad server. - Stop typing and the preview redraws a moment later. There is no Run button — the render happens on its own once the editor goes quiet.
- Click 'Refresh preview' to start the scripts again. Ad tags often fire once per page load, so this is how you re-trigger a tag without rewriting it.
- Set the viewport with the preview size controls: 'Desktop', 'Tablet' (768 × 1024) or 'Mobile' (375 × 667). Ad creatives are frequently sized per breakpoint, so check at least two.
- Drag the bar between the editor and the preview if you want more room on one side. It is a plain split, so you can widen the preview while debugging layout.
- Read the panel under the preview. It lists script errors, files that failed to load, and loops it had to stop, plus a 'Console' showing what the code logged. This is where a blocked tag announces itself.
- If your tag contains ad-server placeholders, open 'Preview macros' to give them values for the preview only. That is how you see a real creative instead of a blank slot.
- When the page behaves, click 'Download HTML' to save
index.htmlexactly as written. It needs no account and is not counted against the daily allowance.
Note that the tool does not keep your code between visits, does not share it by link, does not host it, does not install packages and does not run a build. Download anything you want to keep.
Reading the error panel when a tag fails
Most failed ad tests fall into three buckets, and the panel under the preview separates them for you.
- Script errors. A malformed tag, a missing closing tag, or a call to a function the ad library never defined. The message usually names the file and the line.
- Files that failed to load. The tag requested a script or creative from somewhere and the request did not succeed. That is a network or URL problem, not a syntax problem.
- Loops it had to stop. A runaway loop in the page or in the tag. Ad code that polls for a slot can do this if the slot never appears.
One thing to understand about the preview: the code runs in your browser and is never uploaded to Alvseike, but whatever the code itself links to — a script, a picture, an ad tag — is fetched by the preview from where it lives. So a tag that points at a staging server your machine cannot reach will fail here for the same reason it fails on your desktop browser. That is a feature, not a limitation: you are testing the tag, not the sandbox.
Why a local sandbox beats upload-based ad testers
| In-browser sandbox | Upload-based tester | |
|---|---|---|
| Where your code goes | Stays on your machine | Sent to a third-party server |
| Setup time | Opens ready to type | Account, upload, wait |
| File-size caps | No file-size caps | Often capped by plan |
| Iteration speed | Preview redraws as you type | Re-upload per change |
| Placeholder values | Set locally for the preview | Usually server-side config |
For ad operations work the privacy point is not theoretical. Unreleased campaign tags, internal staging URLs and client identifiers routinely sit inside a tag. Pasting them into a random online tester means handing that data to a service you know nothing about. Code Playground processes the code locally, so the document never leaves the browser.
The speed point compounds. Ad debugging is a loop of small edits — fix a slot id, change a size, retry. A preview that redraws a moment after you stop typing collapses that loop. An upload-based tester adds a round trip to every attempt.
Common mistakes when testing ad tags
Testing the tag without a container. An ad tag is not a page. Paste it into a bare editor with no head, no body and no slot div, and it may fail for reasons that have nothing to do with the tag. Always start from a full document.
Forgetting that the tag fires once. If nothing appears after an edit, click 'Refresh preview' before you assume the change broke something.
Ignoring the placeholder problem. A tag full of unresolved macros renders a blank or a house creative. Use 'Preview macros' to fill them in for the preview only, and you will see what a real impression looks like.
Checking one viewport. A 300 × 250 unit and a 320 × 50 mobile unit are different code paths in many tags. Switch between 'Desktop' and 'Mobile' (375 × 667) before you sign off.
Assuming a blank preview means a broken tag. Read the panel first. A failed script load and a loop that was stopped look identical on screen and completely different in the log.
Pro tips for HTML5 ad preview work
Keep a second copy of your container page in a text file on your machine. The sandbox does not remember code between visits, so the fastest workflow is paste, test, download what changed, and keep the good version locally.
When a creative renders but looks wrong, the problem is usually CSS in your container, not the ad. Ad iframes inherit very little, but a container with a stray max-width, a transform, or an overflow rule can clip a creative. Strip the container to the slot div and retest.
If you need a screenshot of the rendered ad for a client review, capture it and drop it into Mockup Generator to place it in a phone, browser or laptop frame. It reads better in a deck than a raw crop.
If the same creative has to ship in several placements, Social Pack Exporter exports one design to every social size in a single pack, which saves rebuilding the same layout per channel. And if the campaign includes audio, Podcast Artwork Pack turns one square of cover art into every size Apple, Spotify and a host will ask for.
Finally, treat the sandbox as a first pass, not a substitute for a real ad server test. It tells you whether the tag is syntactically sound, whether its dependencies load, and whether the creative draws at the sizes you care about. It will not tell you how a specific exchange bills an impression or how a publisher's consent framework interacts with the tag. Do the cheap check here, then spend your staging environment time on the parts only staging can answer.
The daily allowance on the free plan is 5 runs, and a free account raises that to 15; a run is one export, however many files it contains, and 'Download HTML' is not counted against it at all. If you are testing tags all day, /pricing explains the Pro plan for unlimited daily use.