Skip to main content

Ads and growth

Marketo Munchkin

Munchkin is Adobe Marketo's script for tracking known and anonymous leads on your site. The c15t marketoMunchkin helper waits for marketing consent before it requests Munchkin or initializes tracking. Until then, it creates no Munchkin global, cookie or browser storage.

Munchkin has no API to stop tracking. When the visitor withdraws, c15t removes the loader and reloads the page, and the reload ends tracking.

Configure Marketo Munchkin

Copy your Munchkin account ID from Marketo's installation snippet. Then remove the Munchkin tag from your site, so that c15t controls when it loads.

npm install @c15t/integrations
src/consent-scripts.ts
import { marketoMunchkin } from '@c15t/integrations/marketo';

export const scripts = [marketoMunchkin({ munchkinId: 'AAA-BBB-CCC' })];

Register the scripts

Complete your framework quickstart first. Keep its Inth endpoint, policy, styles and consent UI. Remove the vendor's original script, SDK initializer or tag-manager entry, so the vendor loads only through c15t.

The vendor pages put the helper in src/consent-scripts.ts. If your framework quickstart already has a scripts array, such as the one in c15t.config.ts in the Next.js guide, add the helper to that array instead of creating a second file. The scripts export is a configuration, not an initializer. Add it to the c15t provider you already have, at the registration point for your framework below. These are edits to that provider, not a second provider.

Add the configuration to scripts in c15t.config.ts, next to next.config.ts:

import { defineConsentConfig } from 'c15t/next';
import { scripts } from './src/consent-scripts';

export default defineConsentConfig({ scripts });

Keep the rest of your config, such as mode and routePrefix, in the same call. ConsentRoot reads the config in the browser, so the layout keeps passing only state. App Router, Pages Router and static export all read the same file. See Next.js scripts and embeds.

Options

OptionDefaultBehavior
munchkinIdRequiredPublic account ID. Whitespace is trimmed. If it's missing or blank, c15t logs an error and never loads Munchkin.
initOptions{}Passed to Munchkin.init, for example cookieAnon, anonymizeIP, apiOnly and cookieLifeDays.
categorymarketingConsent condition that gates the whole loader.
scriptUrlhttps://munchkin.marketo.net/munchkin.jsCustom or proxied loader URL. Blank values use the default. Other Munchkin requests need their own proxy configuration.

cookieAnon: false stops Munchkin from creating cookies for new anonymous visitors and tracking them. It is not a consent switch. Visitors who already have a tracking cookie are still tracked.

Loading and revocation

After consent, c15t downloads the SDK and calls Munchkin.init once with the account ID and initOptions. If the visitor withdraws while the SDK downloads, the helper skips initialization. Changes to other categories don't initialize Munchkin again.

Keep reloadOnConsentRevoked enabled. Removing the loader doesn't stop the running SDK or its listeners. The next page doesn't load Munchkin while its consent is denied.

Cookies and storage

Munchkin can set _mkto_trk for two years by default. The reload doesn't remove it. Marketo's separate marketo_opt_out=true URL flow sets mkto_opt_out and turns tracking off. The helper doesn't set that opt-out, because it would also block tracking after a later consent grant.

Verify Marketo Munchkin

Filter the Network panel by munchkin.marketo.net. Before consent, check that there is no loader request, no window.Munchkin, no _mkto_trk cookie and no vendor browser storage. Allow the category set in category, which defaults to marketing, and check that the SDK loads and initializes. Reject that category again and check that the reloaded page makes no Munchkin request. For example, with category: 'experience', allow and reject experience.

Sources: Adobe's async installation snippet and configuration reference.

Test in a private window with an opt-in policy. Open DevTools Network, disable the cache and filter by the vendor's domain:

  1. Load the page. No request goes to the vendor before you choose.
  2. Click Reject, then reload. There is still no vendor request.
  3. Open Privacy settings and allow the helper's category. The vendor script loads without a page reload.
  4. Turn the category off again and save. c15t reloads the page, and the new page makes no vendor request.

c15t reloads on revocation because removing a script element does not stop code that already ran. The vendor's listeners, timers and queued events stay alive until the page unloads. If you set reloadOnConsentRevoked: false, stop the vendor yourself. Register a callback-only script whose onConsentChange calls the vendor's opt-out API, as shown in custom integrations, and check the permission before each of your own event calls. The reload does not delete cookies the vendor already set; see clear on revocation for your framework.

The helper lists its vendor by name in the preference dialog, so a visitor can turn it off inside an allowed category. See vendor consent for your framework. The consent verification guide covers navigation, expiry and hosting checks.