When a new user is created on the site, we currently send Marketo data from several field API fields. We also need to send some of the data from the users table, such as user creation date and uid, but that data isn't available for user field mapping. I think it makes sense to expose some of those fields for mapping: maybe uid, username, created, status, timezone, and language.

CommentFileSizeAuthor
#3 user-metadata-2507733-3.patch2.89 KBjyokum

Comments

jyokum’s picture

ksenzee, you're correct that these fields are not accessible for field mapping but you can get to them if you have Rules enabled on your site. There are three default rules included in the module which perform the same action as the triggered events which can be turned on/off in the User Integration tab of the module config. If you want to try it, disable the "User Registration / Creation" option on that tab then enable the rule "Update Marketo lead on user creation". Edit the rule then edit the action "Add an item to a list". You'll be able to access [account:uid] [account:name] [account:created] etc. from there and can add them to whatever Marketo keys you'd like.

Example rule export:

{ "rules_update_marketo_lead_on_create" : {
    "LABEL" : "Update Marketo lead on user creation",
    "PLUGIN" : "reaction rule",
    "ACTIVE" : false,
    "OWNER" : "rules",
    "TAGS" : [ "Marketo" ],
    "REQUIRES" : [ "rules", "marketo_ma" ],
    "ON" : { "user_insert" : [] },
    "DO" : [
      { "variable_add" : {
          "USING" : { "type" : "list\u003Ctext\u003E" },
          "PROVIDE" : { "variable_added" : { "marketoparams" : "Marketo Parameters" } }
        }
      },
      { "list_add" : {
          "list" : [ "marketoparams" ],
          "item" : "Email|[account:mail]\r\nMarketoFieldA|[account:uid]\r\nMarketoFieldB|[account:name]"
        }
      },
      { "marketo_ma_rules_action_add_lead" : { "account" : [ "account" ], "data" : [ "marketoparams" ] } }
    ]
  }
}

This may get you what you need but I'll look at adding them directly in the core functionality so that sites without Rules can get to them.

ksenzee’s picture

Thanks! That looks like it would work. I think I'm going to solve this for my own site with some custom code that duplicates the user_ hooks in marketo_ma_user, and adds my own data before calling marketo_ma_add_lead(). I already have a need for something similar so it'll serve my purposes. But for other users I think this would be a really helpful feature.

jyokum’s picture

StatusFileSize
new2.89 KB

Here's a patch for 7.x-1.x branch that adds the feature.

  • jyokum committed 80880d5 on 7.x-1.x
    Issue #2507733 by jyokum: Added ability to map user account fields
    
jyokum’s picture

Assigned: Unassigned » jyokum
Status: Active » Fixed

Feature added to 7.x-1.x

With marketo_ma_user enabled, fields can be mapped on the module config page, User Integration tab.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.