I am setting a true false field to "yes" through munchkin code.
The account is created in marketo; however, When I make a smart list for attribute set to true, nothing is returned. I cant set the field to search for "yes" as it auto sets the field back to true.
Please advise.
Solved! Go to Solution.
I think this was an issue on my side. the field is optin_newsletters, but in my code, I have it as optin_newsletter.
I fixed this and it works.
When you say, "through Munchkin code," you mean using associateLead()?
Please show the JS code you're using.
<script type="text/javascript">
jQuery.ajax({
url: '//munchkin.marketo.net/munchkin.js',
dataType: 'script',
cache: true,
success: function() {
Munchkin.init('xyz');
Munchkin.munchkinFunction('visitWebPage', {
url: '/r/thank-you', params: 'registration=1'
});
Munchkin.munchkinFunction('associateLead',
{
FirstName: '{{{ Session::get('lead')['first_name'] }}}',
LastName: '{{{ Session::get('lead')['last_name'] }}}',
Email: '{{{ Str::lower(Session::get('lead')['email']) }}}',
haierOptinExtendedWarranty: '{{{ Session::get('lead')['optin_extended_warranty'] }}}',
haierOptinSeasonalTips: '{{{ Session::get('lead')['optin_newsletters'] }}}',
haierOptinMonthlyNewsletters: '{{{ Session::get('lead')['optin_newsletters'] or 0 }}}',
Phone: '{{{ Session::get('lead')['phone'] }}}',
Address: '{{{ Session::get('lead')['address'] }}}',
Country: '{{{ Session::get('lead')['country'] }}}',
State: '{{{ Session::get('lead')['subdivision'] }}}',
City: '{{{ Session::get('lead')['city'] }}}',
PostalCode: '{{{ Session::get('lead')['postal_code'] }}}'
},
'{{ Session::get('munchkin_api_hash') }}'
);
}
});
</script>