Skip to content

Embedding games

Embedding is the easiest way to add a game: no coding beyond pasting HTML. The dashboard's game page generates the exact code for you.

Responsive embed (recommended)

Fills the width of its container and keeps the shape on phones and desktops.

<div style="position:relative;width:100%;aspect-ratio:16/10;">
  <iframe src="https://play.acbizglobal.net/embed/game/code-breaker?key=pk_live_YOUR_KEY"
          style="position:absolute;inset:0;width:100%;height:100%;border:0;"
          allow="fullscreen; autoplay; gamepad" allowfullscreen loading="lazy"
          title="Code Breaker — ACBIZ Play"></iframe>
</div>

Fixed size

<iframe src="https://play.acbizglobal.net/embed/game/snake?key=pk_live_YOUR_KEY"
        width="800" height="600" style="border:0;max-width:100%;"
        allow="fullscreen; autoplay; gamepad" allowfullscreen title="Snake — ACBIZ Play"></iframe>

Identifying players (optional)

Add &player=ID to link scores to your own user IDs (letters, numbers, _ - . :, max 64 chars). Use an opaque ID — never an email or name.

https://play.acbizglobal.net/embed/game/snake?key=pk_live_YOUR_KEY&player=student-1042

Because anyone can edit a web page, client-side player IDs are marked unverified. For trustworthy leaderboards, create the launch URL on your server with the launch API — those players are marked verified.

What players see

  1. A launch screen with the game title and a Play button (loading this costs nothing).
  2. On Play, a session starts and credits are deducted — once per session, not per round. If the same visitor relaunches the same game within 10 minutes, the existing session is reused at no extra cost.
  3. The game runs for up to 240 minutes; players can play again as many rounds as they like within it.

When something's wrong

Players never see technical errors. Instead the frame shows a short branded message, e.g. "This game is temporarily unavailable" (out of credits) or "This game isn't enabled for this website" (domain not allowed). The SDK also receives an error event with a code — see error codes.

Testing

  • Use your pk_test_… key — free, and works on localhost.
  • The Test it here panel on each game's dashboard page runs the real embed with your test key.
  • Opening a live embed URL directly in a browser tab is blocked on purpose — live games only run inside your pages.

Using the sandbox attribute

You don't need it. If your CMS adds one automatically, it must include allow-scripts allow-same-origin allow-popups, otherwise the game can't start.

Performance

The /embed pages load only the game (no ACBIZ Play menus or feeds), use loading="lazy" so off-screen games don't load, and never set cookies in your visitors' browsers.