How to tie Custom Objects and Companies?

Scott_Horner
Level 2

We do not have CRM synch, but we do have access to the API. We have created a custom object with many company fields and have one field as the link field which is linking to Company >> ID. We are trying to figure out the process of uploading our leads into Marketo, tying those leads to companies and then tying those companies to the custom object. From what I have gathered, the order of operations should be:

  1. Upload contacts (leads) via csv upload with all pertinent data, including company information. External Company ID is not being populated, even though we have included and mapped our data to this field. Is this an API / CRM synch only field?
  2. Upload Custom Object Data, making sure to map our companyID to the link field.

This is where we get stuck. Is the next step to tie the lead and company via the API? If so, will the custom objects then automatically make the tie to the company record? Or is this not the correct order?

10 REPLIES 10
Anonymous
Not applicable

Good day Scott,

We had a similar challenge. So I hope the following is helpful. We wanted to associate all products a company has purchased. We did not want to associate at the lead level. Here is what Marketo told us.

  • You must use the Company API to specify the externalCompanyId. There is no way around it... to do what you are looking for.
  • And I believe the association of leads to the company and thus the Custom Object must happen within the API.  You may want to ask others to chime in or ask support for more details.
  • You may need to contact Marketo Support to add fields to the Company Info record too.

I do think it would be good for someone in Marketo to write how to set up this type of association.

Below is recently update product documentation regarding custom objects and companies.

Using Custom Objects with Companies

A custom object that's linked to the company works best if you sync down companies from the CRM or if you explicitly create companies using the API. We also recommend that you use the Company ID as the link field.

If you have multiple people in Marketo that are lead records in the CRM or Marketo-only records, a custom object linked to a company won't get associated with more than one individual lead record. This is because a company having multiple people underneath it is supported only when companies are synced down from the CRM or if you use an API to explicitly create companies.

  Custom Objects can only directly link to a single lead record. This means that when your custom object type is linked by company field, you should ensure that your person records are associated to a company either using contact conversion in your CRM, or using the externalCompanyId field, if you manage companies using Marketo’s REST APIs. For person records that aren't linked explicitly to company records, custom objects linked using company will be randomly linked to a single lead record, even if the value of the company field is shared across many people. http://docs.marketo.com/display/public/DOCS/Understanding+Marketo+Custom+Objects

Best of luck!

Regards,

Khalilah

Grégoire_Miche2
Level 10

Hi Scott,

In Marketo, the data schema is not fully relational. It is closer to a star model in which the lead table is the center.

This means that the lead - company link is a 1-n by default. This means that one lead can have multiple companies and that the company object needs to have a lead id field to link it to the field. This obviously not what you intend to do, as I understand that what you would like to have each companies having multiple leads.

So you will need to use a n-n model with a joint table to link the leads to companies. This means a "lead role" table that links to the lead on one end and to the company on the other.

The limit of this is that you will not be able to use a 3rd custom object linked to companies, because AFAIK, the Marketo data model for the moment is only limited to 2-levels depth.

-Greg

Scott_Horner
Level 2

Hi Greg,

Thanks for the reply. We do intend to have a 1 - n relationship between lead and company. As I understand it, the company could also have a 1 - n to custom objects, with External Company ID and the link field we designated for the company link in the custom object. I am sure I didn't explain my question very well as this is all new to me, but I am trying to figure out how to make that tie between the custom object and company.

Grégoire_Miche2
Level 10

Hi Scott,

Yes, you are correct you can have 2 custom objects, company and another one, and link them together in a 1-n relationship, as you describe.

But without any link to the lead object, these 2 will be useless in Marketo.

May be you can explicit a little bit more what you are trying to achieve.

-Greg

Scott_Horner
Level 2

We have many online B2B Directories in which a company can be associated to. We are wanting to store specific attributes about that company / directory relationship such as is this company an advertiser in this directory, what advertising package do they have, what is the name of that directory, what is the URL of that directory, etc. So a company can be in many of our directories and we may send an email with information specific to that directory.


When we created a custom object and added a link field called companyID. We chose Company as the Link Object and was presented with only one value for the link field which was Id. I assumed that this was referring to External Company ID as I was thinking that when we initially imported leads into Marketo, we would have that External ID field populated with our companyID, then in the custom object link field called companyID we would have the same ID and this would create the tie.

Grégoire_Miche2
Level 10

HI Scott,

In Marketo, the lead and account (company) object are in fact tightly joined. Although Internally, these are 2 different objects, they cannot really be addressed separately and admins can only add fields to the lead object. So there is an implicit 1-1 link between lead and account.

If I understand the model you would like to implement, it is:

Lead n-1 company 1-n directory entry.

But the issue is that you cannot create a "company" field.

You have 2 solutions in fact:

  1. You create only 1 custom object, called "directory entry "and you link it to the lead, instead of the company. The pros is that the model is quite simple, but the cons is that you will have to duplicate entries in this object for each lead in the company.
  2. You create 2 custom objects. the first one is "directory entry" and has it's own unique ID field. for instance companyID. The second objet is a link object that has 2 link fields: one is the lead ID and the other is the company ID. This one will have to be instantiated for each lead in a given company. And you will have to manage insertion of data in this object as many times as necessary.

-Greg

Scott_Horner
Level 2

I tried option 1 and I think that is going to work for us. How do we get the custom object fields to show in the smart list filters to filter against?

Grégoire_Miche2
Level 10

HI Scott,

You cannot see the custom object fields. You get a "has Directory" filter and in this filter, all the Directory fields will be usable as constraints.

-Greg

Scott_Horner
Level 2

So the fields that are added in the custom object can't be accessed as a token to pull into an email?

Grégoire_Miche2
Level 10

Hi Scott,

Not as simple tokens. But through email script tokens, yes, it is possible.

-Greg