Configuration

Munchkin can accept a variety of configuration settings to customize behavior. Configuration settings are properties of a JavaScript object that is passed as the second parameter when calling Munchkin.init().

The configuration settings object can contain any number of properties from the table below.

Properties

Name Data Type Description
altIds Array Accepts an array of Munchkin ID strings. When enabled, this will duplicate all Web Activity to the targeted subscriptions, based on their Munchkin ID.
anonymizeIP Boolean Anonymizes the IP address recorded in Marketo for new visitors.

You can determine if you’re subscription is provisioned with Munchkin V2 by checking if your {Munchkin-Id}.mktoresp.com domain has one of the following addresses

  • 192.28.144.124
  • 134.213.193.62
  • 192.28.147.68
  • 103.237.104.82

Alternatively, you can run the script below from a unix shell:

nslookup {munchkin-id}.mktoresp.com | grep -E -c -e "(192\.28\.144\.124|134\.213\.193\.62|192\.28\.147\.68|103\.237\.104\.82)"

If the command outputs ‘0’ then your subscription is not provisioned with Munchkin V2; if it outputs 1 or greater, then it is.

apiOnly Boolean If set to true, then Munchkin.Init() function will not call visitsWebPage.  This is useful for single page web applications that need full control over every visitsWebPage event.
asyncOnly Boolean If set to true, will send XMLHttpRequest’s asynchronously. Default is false.
clickTime Integer Sets amount of time to block after a click to allow for click tracking request (in milliseconds). Reducing this will reduce accuracy of click-tracking. Default is 350 ms.
cookieAnon Boolean If set to false, will prevent tracking and cookie creation of new anonymous leads. Leads are cookied and tracked after filling out a Marketo form, or by clicking through from a Marketo Email. Default is true.
cookieLifeDays Integer Sets the expiry date of any newly created Munchkin tracking cookies to this many days in the future. Default is 730 days (2 years).
customName String Custom page name.  System use only.
domainLevel Integer Sets the number of parts from the page’s domain to use when setting the domain attribute of the cookie.

For example, suppose the current page domain is “www.example.com”.

domainLevel: 2 will set the cookie domain attribute to “.example.com”

domainLevel: 3 will set the cookie domain attribute to “.www.example.com”

Background:

Munchkin will automatically manage certain two letter top-level domains.

This defaults to two parts in normal cases where the top-level domain is three letters. For example “www.example.com”, the two rightmost parts will be used to set the cookie, “.example.com”.

For two letter country codes such as “.jp”, “.us”, “.cn”, and “.uk”, the code will default to three parts. For example “www.example.co.jp” will use three rightmost domain parts, “.example.co.jp”.

If the domain pattern requires a different behavior, then this must be specified using the domainLevel parameter.

domainSelectorV2 Boolean If set to true, utilizes an improved method to determine how to set the cookie domain attribute.
httpsOnly Boolean Defaults to false.  When set to true, sets cookie to use Secure setting when the tracked page was served via https.
useBeaconAPI Boolean Defaults to false.  When set to true, uses the Beacon API to send non-blocking requests instead of XMLHttpRequest.  If the browser does not support this API, the Munchkin will fallback to using XMLHttpRequest.
wsInfo String Takes a string to target a workspace. This workspace ID is obtained by selecting the Workspace in the Admin > Integration > Munchkin menu.

Note that this setting only applies to the initial creation of an anonymous lead record.  Once the Munchkin cookie value has been established for that lead record, the wsInfo parameter cannot be used to change its partition.

Since this setting only effects anonymous leads, it is only relevant to partition-specific Anonymous Visitors in Web Reports.

 

Examples

Send Activity to Multiple Subscriptions

This example will send all web activity to the instances with Munchkin IDs “AAA-BBB-CCC” and “XXX-YYY-ZZZ”.

Set Tracking to Asynchronous

This example will force all XMLHttpRequest’s to be sent asynchronously from the main thread.