Marketing Integrations

dbhoward
Participant

Salesforce integration - synching UTM fields to Leads or Contacts

SOLVE

I'm capturing in HubSpot the standard UTM tagged field for URLs in Google ads - utm_campaign, etc.

 

I have run into this problem in the past, and can't recall a resolution...

 

Some people who fill out a form submission from AdWords will be Leads in Salesforce, other will be contacts.

 

The HubSpot connector to Salesforce requires, essentially, the Salesforce API name for the field to synch - e.g. utm_campaign__c

 

But in Salesforce, the same field "utm_campaign" has to have a unique API name, so, if HubSpot captures this for a contact record in salesforce, the data won't synch to the contact record, because the API name for "utm_contact" in SFDC is different than what HubSpot uses to synch to a lead record.

 

Is there a resolution for this?

0 Upvotes
1 Accepted solution
bradmin
Solution
Key Advisor

Salesforce integration - synching UTM fields to Leads or Contacts

SOLVE

The only way Salesforce wouldn't let you create $Contact.utm_campaign__c is if $Contact.utm_campaign__c already exists. It's possible that there's another user that's already created that field, and hasn't enabled you visibility into seeing it - so you'd be creating what you think is a unique field on an object, but in actuality, it's duplicated. 

 

If no such conflict exists, there shouldn't be a reason Salesforce is preventing the create, unless you lack the ability to create fields on any object. The object-field pair must be unique, and you cannot create the same field name on the same object; otherwise, duplicated field names can live on multiple objects, as long as they don't exist more than one time on an object.


Brad Mampe, Salesforce Analyst, Fidelity
I'm probably wrong. I may not be right about that.

View solution in original post

0 Upvotes
10 Replies 10
bradmin
Key Advisor

Salesforce integration - synching UTM fields to Leads or Contacts

SOLVE

Hi, @dbhoward. As a general rule, if you can put it in a property, you can sync it to Salesforce. The issue here is that UTM codes are not natively housed in a property in HubSpot. 

 

This leaves two basic options, each as practical as they are undesirable. You can do custom development to pass UTM codes from form submissions into a custom property of your choosing (mapped to Salesforce), or you can map a native property like Last Page Seen to Salesforce, then run Salesforce-side automation which parses out the UTM code when that URL has "utm" or some other unique string in it.


Brad Mampe, Salesforce Analyst, Fidelity
I'm probably wrong. I may not be right about that.
0 Upvotes
dbhoward
Participant

Salesforce integration - synching UTM fields to Leads or Contacts

SOLVE

There is no custom development required. I am already passing utm values - from a tagged URL in Google Ads - to HubSpot, and the values are recorded in the custom fields I defined in HubSpot.

 

The problem is that HubSpot can't determine that the destination record on Salesforce is a contact, instead of a lead, and map to the contact-specific field API labels.

0 Upvotes
bradmin
Key Advisor

Salesforce integration - synching UTM fields to Leads or Contacts

SOLVE

Apologies about that, I misread. 

 

If the API name of the field doesn't exactly match, you'll need to duplicate the mappings from Adwords to both utm_campaign__c and utm_contact__c, if possible. As a best practice, and if it's possible, I recommend changing the API name of the field on contacts to match the lead field - that way, on syncing to either a lead or contact, utm_campaign__c will always have the desired value. 


Brad Mampe, Salesforce Analyst, Fidelity
I'm probably wrong. I may not be right about that.
0 Upvotes
dbhoward
Participant

Salesforce integration - synching UTM fields to Leads or Contacts

SOLVE

>>As a best practice, and if it's possible, I recommend changing the API name of the field on contacts to match the lead field

 

It's not possible. It's a structural issue with Salesforce - internal API names must be unique across objects. 😞

0 Upvotes
bradmin
Key Advisor

Salesforce integration - synching UTM fields to Leads or Contacts

SOLVE

That definitely is possible. I've got hundreds of mappings where $Lead.Custom_Field__c has the same API name as $Contact.Custom_Field__c. 

 

If you're saying that's an organizational limitation, you're going to have to do some sort of manipulation on the Salesforce side to handle this, although if duplicating the Adwords mapping to both fields is possible, that should resolve your issues - the connector will send to field A and field B at the same time, only populating whatever field is valid for that object in Salesforce. 


Brad Mampe, Salesforce Analyst, Fidelity
I'm probably wrong. I may not be right about that.
0 Upvotes
bradmin
Key Advisor

Salesforce integration - synching UTM fields to Leads or Contacts

SOLVE

If this is a value which is set once and only once, HS workflows may be a help. You could set a workflow that fires when UTM_campaign__c is known, and the Salesforce Contact ID is known, copying the UTM_campaign__c value to UTM_contact__c.

 

You'd also need another workflow doing the reverse, when UTM contact is known, Salesforce Lead ID is known, but Salesforce Contact ID is not known. Since a converted lead in Salesforce will have both its Lead ID and Contact IDs written to the HubSpot contact's history, you'd want to explicitly define Lead ID is known AND Contact ID not known for this second case to work. 


Brad Mampe, Salesforce Analyst, Fidelity
I'm probably wrong. I may not be right about that.
0 Upvotes
dbhoward
Participant

Salesforce integration - synching UTM fields to Leads or Contacts

SOLVE

>> I've got hundreds of mappings where $Lead.Custom_Field__c has the same API name as $Contact.Custom_Field__c. 

 

This is the heart of my question - how did you manage to do that?

 

There's very little to no customization in our SFDC org.

 

Simply creating, for example, utm_campaign in the Contact object, SFDC won't let me assign the same internal API name.

 

How did you do it?

0 Upvotes
bradmin
Solution
Key Advisor

Salesforce integration - synching UTM fields to Leads or Contacts

SOLVE

The only way Salesforce wouldn't let you create $Contact.utm_campaign__c is if $Contact.utm_campaign__c already exists. It's possible that there's another user that's already created that field, and hasn't enabled you visibility into seeing it - so you'd be creating what you think is a unique field on an object, but in actuality, it's duplicated. 

 

If no such conflict exists, there shouldn't be a reason Salesforce is preventing the create, unless you lack the ability to create fields on any object. The object-field pair must be unique, and you cannot create the same field name on the same object; otherwise, duplicated field names can live on multiple objects, as long as they don't exist more than one time on an object.


Brad Mampe, Salesforce Analyst, Fidelity
I'm probably wrong. I may not be right about that.
0 Upvotes
dbhoward
Participant

Salesforce integration - synching UTM fields to Leads or Contacts

SOLVE

This is very interesting.

 

When creating the fields in the contact record, I tried to set the internal API name, but it threw an error, saying it must be unique.

 

Now that I look at the fields, both Leads and Contact have the same internal api name, e.g. utm_campaign__c

 

So, perhaps all is good and well.

 

P.S. It may have been me stepping on myself. Maybe I had already created the field in the Contact object, then went to try to create it a second time, which threw the error.

dbhoward
Participant

Salesforce integration - synching UTM fields to Leads or Contacts

SOLVE

Suggested possible workarounds so far:

 

1) Tag each URL with twice as many UTM parameters - one that maps to a lead record, one that maps to a contact record.

2) Create duplicate UTM paramaters on a hubspot record, one set for leads, one for contacts. Capture from the tagged URL values for the Lead record, then add a workflow to copy to the dupe field for the contact record

 

0 Upvotes