What Is Exit API in Google Ads? A Plain Guide

The Exit API is the small hook that lets an HTML5 ad hand a click over to Google Ads instead of opening a URL itself. Here is what it does, why it exists, and where playable ads usually go wrong with it.

By the PlayableRun team··7 min read

Key takeaways - The Exit API is a function your HTML5 ad calls so that Google Ads, not your code, handles the click and the redirect. - The destination URL lives in the Google Ads campaign, never in the creative file. - It serves the same purpose as clickTag, but works by calling a function instead of reading a URL variable. Check which one your campaign type requires. - For playables, call it from a clear, deliberate tap such as the install button or end card, not from every touch. - Most Exit API problems come from window.open, hardcoded store links, or a missing script reference.

What the Exit API is

The Exit API is a small piece of JavaScript that Google supplies for HTML5 ads. Your ad calls ExitApi.exit() when the user does something that should take them to the destination. Google Ads then records the click and sends the user to the URL configured in the campaign.

That is the whole idea. The ad says "the user wants to leave now." Google decides what that means: which URL, which tracking, which redirect chain.

If you have worked with older display banners, this will feel familiar. It is the same problem clickTag solves, just with a different mechanism. If you want the background, read What Is clickTag? A Plain-English Guide for HTML5 Ads.

Why it exists

An HTML5 ad is a small web page running inside someone else's page or app. That creates three problems.

  1. Measurement. Google needs to count every click. If the creative opens a URL by itself, that click may never be recorded.
  2. Control. Advertisers change destinations, add tracking parameters, and swap store links. They should not have to rebuild and re-upload the creative every time.
  3. Safety. Ads running inside webviews and iframes are restricted on purpose. Opening new windows from inside an ad is a classic abuse pattern, so networks route exits through a controlled path.

The Exit API solves all three by keeping the click logic outside your file. Your creative only reports intent.

How it differs from clickTag

Both exist to keep the destination out of your code. The difference is who does the work.

  • With clickTag, the platform passes a URL into the ad, usually as a variable. Your code reads it and sends the user there.
  • With the Exit API, your code calls a function provided by the platform. You never see or handle the URL.

For a producer, the Exit API is the simpler model. There is less to get wrong, because there is no URL to read, validate, or accidentally replace.

Which one a given campaign type expects has changed over time and differs between formats. Do not rely on memory, including this article. Check the current HTML5 requirements for your campaign type in Google Ads Help before you build. The article on Google Ads HTML5 eligibility covers account-side readiness.

What it looks like in practice

You do not need much code. The pattern has two parts.

  • The Google-provided Exit API script is referenced in the page, exactly as Google's documentation describes.
  • A click handler on your button or end card calls ExitApi.exit().

That is all. No URL, no query string, no tracking logic.

For a playable, the handler usually lives on one of these elements:

  • The install button on the end card.
  • A persistent call-to-action visible during play.
  • The whole end card, if the design makes the whole screen a clear tap target.

Keep the handler on a real user gesture such as a tap or click. Calling the exit from a timer or automatic event is the kind of behavior that gets ads flagged. See Misleading Playable Ads: Fake-Play vs Real-Play Risk for where networks draw the line.

Why not just use window.open?

It is tempting. window.open(storeUrl) works in a browser test, so it looks done. In a real ad placement it causes trouble:

  • The click may not be counted, so the campaign reports look wrong.
  • Browsers and webviews can treat window.open calls from embedded content as popups and block them, especially when they are not clearly tied to a user gesture.
  • The destination is frozen into the file. Changing it means a new build and a new upload.
  • Validators and reviewers may reject the creative.

A creative that "works on my laptop" but bypasses the Exit API is one of the most common false-positive tests in HTML5 ad production.

The Exit API and self-contained ads

Google requires HTML5 ads to be packaged so they do not pull in outside resources. That is why most guidance says no CDNs, no web fonts, no remote images. The Exit API script is the one reference the documentation explicitly tells you to include, so follow Google's instructions on exactly how to reference it. Any other external reference is still a risk.

If you are unsure what counts as an outside dependency, read Self Contained HTML5 Ad: No CDNs, No Web Fonts. If the validator complains after upload, Google Ads HTML5 Validator Errors Explained goes through the usual messages.

Common mistakes

These are the problems that come up most often.

Hardcoding the store URL

Putting an App Store or Google Play link in the HTML feels harmless. It breaks the point of the API, undermines tracking, and may fail review. The campaign should own the destination.

Forgetting the script reference

If the Exit API script is not present when the handler runs, ExitApi is undefined and the tap does nothing. In a quick preview this can look like a dead button. Make sure the reference matches Google's current documentation.

Mixing clickTag and the Exit API

Some teams carry over a banner template that already has a clickTag handler, then add the Exit API on top. Now two exits can fire or conflict. Pick the mechanism the campaign type requires and remove the other.

Firing on every touch

Playables are interactive. If every touch calls the exit, users are sent away mid-play, often by accident. Reserve the exit for deliberate CTAs.

Multiple exits with no plan

A playable may have a button on the gameplay screen, another on the end card, and a tap-anywhere area. That is fine if each one is intentional. If you need different behavior for different elements, read the current docs on whether and how multiple exits are supported rather than guessing.

Leaving a test stub in the build

For local testing, many developers define a fake ExitApi that logs to the console. That is reasonable. Shipping it is not, because it can shadow or interfere with the real implementation. Strip it before export.

How to test it

A short, repeatable routine catches most problems.

  1. Play it locally with a logging stub and confirm each intended CTA triggers exactly one exit call.
  2. Tap non-CTA areas during gameplay and confirm nothing triggers the exit.
  3. Upload the ZIP to Google Ads and run it through the validator.
  4. Use the preview and tap the CTA. Confirm it behaves as a real click, not as a popup.
  5. Check the campaign's final URL is the one you expect, because that is what the click will use.
  6. Test on a real device if possible. Webviews on phones behave differently from desktop browsers.

If you are building many variants, put this into a checklist so it happens every time, not just on the first creative.

Where this fits in a playable workflow

The Exit API is a small detail, but it sits at the most important moment in a playable: the tap that turns attention into an install. A broken exit means the ad can look fine, play fine, and still produce nothing.

That is also why tooling matters. PlayableRun builds a Google Ads-ready ZIP from a store listing, so you are not hand-wiring click handling for each export. You should still preview and validate every file, because campaign types and requirements change.

For background on what is inside these packages, see What Is an HTML5 Ad? What's Inside the ZIP.

Quick reference

  • What it is: a Google-provided function the ad calls to report a click.
  • What it replaces: direct URL opening from inside the creative.
  • Where the URL lives: in the Google Ads campaign.
  • When to call it: on a deliberate user tap on a clear CTA.
  • What to avoid: window.open, hardcoded store links, mixing with clickTag, firing on every touch.
  • Where to confirm details: the current HTML5 requirements in Google's documentation.

If you want to see how a finished playable handles the install tap, browse the live demos. If you would rather try it with your own listing, you can create a free account and check the exported ZIP against Google's validator yourself.

Frequently asked questions

›What is the Exit API in Google Ads?

It is a small JavaScript interface that Google provides for HTML5 ads. Your ad calls it when the user taps something that should lead to the destination, and Google Ads handles the click: tracking, then the redirect to the URL set in the campaign.

›Is the Exit API the same as clickTag?

No, but they solve the same problem. clickTag passes the click-through URL into the ad as a variable that the ad opens. The Exit API has the ad call a function and lets Google Ads decide where the click goes. Which one a campaign type expects is stated in Google's current HTML5 requirements.

›Can I use window.open instead of the Exit API?

You should not. A direct window.open call bypasses Google's click tracking and may be blocked as a popup. It is also a common reason an HTML5 upload is rejected or behaves differently in review.

›Where do I set the destination URL when using the Exit API?

In the campaign or ad settings inside Google Ads, not in the HTML file. Hardcoding a store link in the creative defeats the purpose of the API and can cause disapproval.

›How do I test the Exit API before uploading?

Use the preview in Google Ads and run the ZIP through the upload validator. For local testing, a temporary stub that logs the call is fine, but remove it before export so it does not interfere with the real one.

Sources

Turn your store listing into a playable

Paste an App Store or Google Play link and get an HTML5 playable you can test in minutes. The first one is free.

Keep reading