Implementing DoubleClick Campaign Manager ExitApi in HTML5 Ads
While standard Google Ads campaigns rely on the clickTag variable to track exits, Campaign Manager 360 (CM360) and Display & Video 360 (DV360) support an alternative corporate standard: the Enabler ExitApi. This API allows for complex landing page actions, dynamic redirects, and multiple exit event tracking.
Including the Enabler Script
To use the ExitApi, your primary HTML document must load the doubleclick Enabler JS library inside the <head> before your custom layout scripts:
<script src="https://s0.2mdn.net/ads/studio/Enabler.js"></script>
Defining and Triggering the Exit Event
Once the library is loaded, you can call the exit function inside your button event listeners. Unlike clickTag, ExitApi checks if the Enabler is fully initialized before firing:
<button id="cta-button">Shop Now</button>
<script type="text/javascript">
document.getElementById('cta-button').addEventListener('click', function() {
if (window.Enabler && Enabler.isInitialized()) {
Enabler.exit('CTA Click');
} else {
// Fallback
window.open(window.clickTag || "https://example.com", "_blank");
}
});
</script>
The exit string parameter (e.g. 'CTA Click') will map to a custom click exit event in the CM360 trafficking interface, allowing ad ops teams to override destination URLs individually.