Drupal Association members fund grants that make connections all over the world.
This is a simple module for adding & managing the Marketo Munchkin tracking code and provides a method for utilizing the Marketo Munchkin API to allow Lead submission to your Marketo account for your site's forms.
The Marketo Munchkin module defines an API for developers to use for submitting Lead data from their site's forms using the Marketo Munchkin API. There are several hooks which can be used to modify Lead data prior to submission:
- Create a list of data to be associated with every Lead submission.
- Create a list of data to be associated with Leads using a specific form.
- Alter the list of data being associated with Leads using a specific form.
The Marketo Munchkin module requires no third party library. Installing the marketo munchkin module is straight forward and the same as other Drupal contributed modules. Refer to Installing contributed modules for more information.
To configure the Marketo Munchkin module go to Administration > Configuration > Search and Metadata > Marketo Munchkin or admin/config/search/marketo-munchkin.
- Munchkin code: The minimum data you will need to configure the Marketo Munchkin module is a tracking code obtained from Marketo.com. That tracking code will allow you to utilize the cookie Marketo Munchkin creates for each user visiting your site. This should be something like '123-ABC-123'.
- Munchkin Secret Key: To utilize the Lead Data submission hooks you will also need to provide your Marketo secret private key. This is the key that is created while enabling API tracking at Marketo.com for the Munchkin tracking service. This should be a string with no spaces.
- Obtain a tracking code from Marketo.com.
- Set the 'Munchkin code' configuration as your tracking code.
- Marketo's Munchkin cookie will now be applied to your site's visitors.
Lead Data Submission
- Obtain a tracking code and secret private key from Marketo.com.
- Set the module's configurations accordingly.
- Modify a form to tell the Marketo Munchkin module that you want to submit some data and associate it with a lead.
- Provide some data to be associated with a lead. The only piece of data required is an email address but it is possible to include names, addresses, phone numbers, or any other data field including custom fields.
- Implement either hook_marketo_create_data() or hook_marketo_create_TYPE_data() to add the lead data to the $munchkin_data array. This is an associative array keyed with strings representing the field names and the value is the data being passed. Some examples:
- $munchkin_data['FirstName'] = 'John';
- $munchkin_data['LastName'] = 'Doe';
- $munchkin_data['Title'] = 'Lead Buck';
Example implementations for each marketo hook are included in the marketo_munchkin.examples.php file. You can also see hook related documentation in the marketo_munchkin.api.php file.