ClickTag implementation for Campaign Manager 360 (CM360)

Google Campaign Manager 360 (formerly DoubleClick Campaign Manager) expects a global clickTag variable in your HTML5 creative. This guide covers the standard implementation, common errors, and how Adloom detects and fixes CM360 clickTag issues automatically.

How CM360 clickTag works

CM360 requires a global JavaScript variable named clickTag that holds the click-through URL. Campaign Manager 360 replaces this URL at serve time with the actual destination URL. The clickTag must be declared as a var (not let or const) in the global scope of your HTML document.

The variable must be accessible to any click handlers in your creative. When a user clicks on your ad, your JavaScript code retrieves the clickTag value and uses it as the destination URL.

Standard implementation

Here is the recommended pattern for CM360 clickTag implementation in your HTML5 creative:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Ad Creative</title>
  <style>
    body { margin: 0; padding: 0; }
    .ad-container { width: 300px; height: 250px; background: #000; cursor: pointer; }
  </style>
</head>
<body>
  <div class="ad-container" id="adElement"></div>

  <script>
    // Declare clickTag in global scope
    var clickTag = "https://example.com";

    // Handle click
    document.getElementById("adElement").addEventListener("click", function() {
      window.open(clickTag, "_blank");
    });
  </script>
</body>
</html>

Key points: clickTag is declared as var at the top level, assigned a fallback URL (example.com), and accessible to your click handler.

Common errors to avoid

Using let or const instead of var

CM360 needs a global variable. Using let or const creates block-scoped variables that Campaign Manager cannot reliably access.

// WRONG
let clickTag = "https://example.com";
const clickTag = "https://example.com";

// CORRECT
var clickTag = "https://example.com";

Declaring clickTag inside a function

The variable must be in the global scope. If declared inside a function, Campaign Manager will not find it.

// WRONG
function init() {
  var clickTag = "https://example.com";
}

// CORRECT
var clickTag = "https://example.com";
function handleClick() {
  window.open(clickTag, "_blank");
}

Wrong variable name

Case sensitivity matters. The variable must be exactly clickTag (with capital T), not clicktag, ClickTag, or click_tag.

No fallback URL

Always provide a fallback URL. If Campaign Manager cannot inject a URL (e.g. during testing), the fallback ensures the creative remains clickable.

// WRONG
var clickTag;

// CORRECT
var clickTag = "https://example.com";

Note: DV360 and Enabler SDK

Google Display and Video 360 (DV360) serves creatives through the Enabler SDK. The Enabler SDK wraps the Campaign Manager 360 clickTag system, so creatives built for CM360 using the standard var clickTag pattern work seamlessly in DV360 as well. You don't need a separate implementation.

Adloom treats CM360 and DV360 clickTag implementations as compatible. If your creative works in Campaign Manager 360, it will work in DV360.

How Adloom detects CM360 clickTag

Adloom scans your creative's HTML and JavaScript using pattern matching to find clickTag implementations. It looks for the regex pattern:

/var\s+clickTag\s*=\s*["']([^"']+)["']/

This pattern matches declarations like var clickTag = "https://..." anywhere in your HTML or external JavaScript files.

Adloom also validates that clickTag is accessible from the global scope and that your click handlers correctly reference it.

How Adloom auto-fixes missing clickTag

If Adloom detects that your creative is missing the clickTag variable, it can automatically inject it. Here's what happens:

1.
Adloom identifies your main HTML file (typically index.html).
2.
It injects a global var clickTag = "https://example.com"; declaration in a script tag in the <head> section, before any other scripts that might reference clickTag.
3.
It saves the fixed creative as a new ZIP file ready for upload.

The injected clickTag uses a valid fallback URL, ensuring your creative remains functional during testing and preview.

How Adloom helps

Auto-detect clickTag format

Upload your creative and Adloom instantly identifies whether it includes a CM360 clickTag, what format it uses, and whether it's correctly scoped.

Check multi-platform compatibility

Adloom shows you which other platforms (DV360, Adform, Amazon Ad Server, etc.) your current CM360 creative is compatible with, or what changes are needed.

One-click auto-fix

If your clickTag is missing or malformed, use Adloom's "Fix all" button to inject a correct CM360 clickTag in one click. No manual editing needed.

Convert between platforms

Have a creative built for another platform? Adloom can auto-convert it to CM360 format (and vice versa) with a single click, handling all clickTag syntax differences.

Next steps