Updating marketo leading information

First, I join the leadership when a user subscribes to our application within 14 days of the trial period.

function associateMarketoLead() {
 if (window.marketoKey)) {
  if (typeof Munchkin !== 'undefined') {
   if ('function' === typeof Munchkin.munchkinFunction) {
    let leadAttributes = {
      Email: user.email,
      accountId: accountId,
      LeadSource: 'Web'
    };

    Munchkin.munchkinFunction('associateLead', leadAttributes, marketoKey);
   }
  }
 }
}

We use marketo to send email campaigns at the end of a 14-day trial. But, for some reason, we are extending the trial period, so we want to update the leading database with an extended validation date. How can i do this? I tried the following, but it does not work.

function notifyMarketoOnTrialExtension(accountId, trialExtendedDate) {
 if (window.marketoKey) {
  if (typeof Munchkin !== 'undefined') {
   if ('function' === typeof Munchkin.munchkinFunction) {
    var leadAttributes = {
      Email: user.email,
      accountId: accountId,
      trialExtendedDate: trialExtendedDate
    };

    Munchkin.munchkinFunction('associateLead', leadAttributes, window.marketoKey);
   }
  }
 }
}

Any suggestions?

0
source share
1 answer

, associateLead ( ), SHA1 , , . .

SHA1 //cdnjs.cloudflare.com/ajax/libs/jsSHA/2.0.2/sha1.js

var email = 'user@domain.com';
var shaObj = new jsSHA('SHA-1', 'TEXT');
shaObj.update('<your-munchkin-private-key-goes-here>' + email);
var hash = shaObj.getHash('HEX');
Munchkin.init('<your-munchkin-identifier-goes-here>');
Munchkin.munchkinFunction('associateLead', { 'Email': email }, hash);

, .

.

+1

Source: https://habr.com/ru/post/1659665/


All Articles