0

最初,当用户在 14 天的试用期内注册我们的应用程序时,我会关联潜在客户。

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);
   }
  }
 }
}

我们使用 marketo 在 14 天试用期结束时发送电子邮件活动。但是,对于某些潜在客户,我们会延长试用期,因此我们希望使用试用延长日期更新潜在客户的数据库。我怎样才能做到这一点 ?我尝试了以下方法,但它不起作用

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);
   }
  }
 }
}

有什么建议么 ?

4

1 回答 1

1

这个小片段向您展示了如何使用正确的密钥(第三个参数)进行调用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);

希望能帮助到你。

阿莱霍。

于 2016-02-29T21:52:40.557 回答