How to Attribute UTM Parameters to Salesforce Campaigns
- March 31, 2022
- Pardot Forms, Salesforce Ben | The Drip, Salesforce Campaigns
Monitoring marketing channel performance in Salesforce (and Pardot) by each campaign is a challenge – and it’s even harder to determine which channel contributed to a prospect engaging with that campaign.
When it comes to collating this information into Salesforce Campaigns and Campaign Members (ultimately to utilize Campaign Influence), I’ve seen organizations create child Campaigns – one per channel (!) – to get a handle on this level of channel attribution. The downside is that not only does maintaining multiple campaigns and creating numerous assets waste time, but you also use an additional level within your Campaign hierarchy (that can only be a maximum of 5 levels).
There’s a better way, that taps into Salesforce Flow. In this guide, I’m going to show you how to use Salesforce Flow to stamp UTM parameters on the Campaign Member. You’ll have this granular channel performance data, without creating separate campaigns or duplicating marketing assets per channel.
Cool, let’s get straight to it!
Create UTM Custom Fields (Leads and Contacts)
For standard UTM tracking, you will want to create the following fields in both Pardot and Salesforce, exactly as shown:
- utm_source
- utm_medium
- utm_campaign
- utm_content
- utm_term
This tutorial won’t cover how to create the UTM fields, JavaScript, or forms in Pardot to capture this data; if you are looking for guidance on this part, Hollie Fitzpatrick will guide you here. This tutorial is purely how get these values onto the Campaign Member records, using Salesforce Flow.
Also, note that in this tutorial (compared to Hollie’s), I’ve added “last touch” to the end of the field names to be more descriptive, but the process is the same.
Assuming you have already created the last touch UTM fields on the Lead and Contact records (those bullet pointed above), we now need to create the same fields that will help us check if the values have changed. As a result, we won’t sync historical, out dated UTM values into our Campaigns.
Repeat steps 1-3 below to create the following fields (on both Leads and Contacts):
- utm_source checked
- utm_medium checked
- utm_campaign checked
- utm_content checked
- utm_term checked
- In Salesforce, go to Setup (the cog in the top right corner). Click on Object Manager and go to Lead.
- Create a new field, and select text as the data type*. Call it “utm_source check”.
- Select the profiles that should see this field. Leave off from page layouts as it’s only used for the Flow (automation). Hit Save and New, so you can repeat these steps faster for “utm_medium check” etc.
I’ve done the Lead object but you must repeat these steps for Contacts.
*The reason we aren’t using a boolean field (like a checkbox) is that we need to be able to say, field by field, that there is a difference. You’ll see this in action later.
Create UTM Custom Fields (Campaign Members)
Within Object Manager, go to the Campaign Member object and create the 5 UTM fields (eg. “utm_source”) the same way you did for the Leads and Contacts.
The Campaign Member record should look like this:
Awesome, now the fields are in place, we’re ready to build the Flow.
Building the Salesforce Flow
This is the Salesforce Flow that we’ll be using to stamp UTM parameters on the Campaign Member. I’ll break each step down and explain the logic.
1. Triggering the Flow
- Select the Campaign Member as the object that will trigger the Flow.
- Select when the record is created, along with Actions and Related Records.
This step needs to be when the record is created and not when the record is updated.
That way, we can be sure that the values that are attributed to the Campaign are true at the point the prospect (Lead/Contact) became a Campaign Member, and not synced to the Campaign Member later if the Lead/Contact record was edited in any way.
2. Decide if the Campaign Member is a Lead or Contact
The Campaign Member record can be related to either a Lead or a Contact, so we need to decide which record we are dealing with; that way, the Flow will use the correct record IDs in the steps that follow.
Create two outcomes, one for Lead and one for Contact.
- For the Lead outcome, make sure all conditions are met. Select Record (Campaign Member) → Lead ID → ID
- Select Is Null for the Operator. Global Constant is False.
- Select Record → Contact ID → ID. Operator Is Null and Global Constant is True.
- For the Contact outcome, repeat the steps with some changes. Make sure all conditions are met. Select Record (Campaign Member) → Contact ID → ID
- Select Is Null for the Operator. Global Constant is False.
- Select Record → Lead ID → ID. Operator Is Null and Global Constant is True.
The next steps for each path are identical, whether it’s a Lead or Contact. I’ll continue to use the Lead for this example, but for the Contact path, just swap out the Lead IDs for the Contact IDs.
3. Decide if the UTMs Have Changed
Now we come to the part of the Flow that will decide if the UTM parameters are different between the UTM last touch fields and the “check” fields we created earlier (ie. “utm_source” is different to “utm_source check”).
I’ve decided to stamp the Campaign Member with the values, even if just one value is different. The reason for this is a prospect can, for example, come through social for two campaigns but to only stamp those values that are different would mean we miss out on attributing social to the second campaign, since the value (“social”) isn’t different.
So, I’ve decided to use OR logic for the check, and assume that if one parameter is different, then the rest will be updated, too.
- Create two outcomes, one called “utms are different” and the other default outcome as “utms are the same”.
- For “utms are different”, ensure any condition is met.
- In resource, select Record (Campaign Member) → Lead ID → utm source last touch field. Select Does Not Equal as your operator.
- In value, select Record (Campaign Member) → Lead ID → the corresponding check field (in this case, “utm_source check”)
- Repeat for the remaining fields.
Your decision node should now look like this:
4. Update Campaign Member Record with the new UTM parameters
- Select “Use the Campaign Member that triggered the Flow”
- For Filter Conditions, leave as: None – Always Update Record
- Select the UTM fields and for the value, select the corresponding last touch field from the lead record. For example, “utm_source” → Record → Lead ID → utm_source last touch.
5. Transfer the values to the “check” fields
Finally, we need to update the “check” fields with the last touch values; that way, the Flow can run the checks next time, if our Lead/Contact becomes a Campaign Member of another Campaign in the future.
- Select “Specify Conditions to identify records…”
- Ensure all conditions are met → ID → equals → Record (Campaign Member) → Lead ID.
- Under fields, select the check fields you created earlier.
- In value, select the corresponding last touch fields from the Lead object.
Now, repeat the process for Contacts!
Summary
Having UTM parameters attributed to the Campaign Member is a fantastic way to monitoring which channels are contributing to Campaign success. You’ll avoid creating separate campaigns or duplicating marketing assets per channel – saving so much time, and resulting in a cleaner data model for reporting.
In this guide, I showed you how to use a Salesforce Flow to stamp UTM parameters on the Campaign Member.
If you need help to put something in place that will determine the success of all your marketing channels, get in touch and we’ll help you put a winning Campaign Hierarchy in place.
This Pardot article written by:
Salesforce Ben | The Drip
Lucy Mazalon is the Head Editor & Operations Director at Salesforceben.com, Founder of THE DRIP and Salesforce Marketing Champion 2020.
Original Pardot Article: https://www.salesforceben.com/the-drip/how-to-attribute-utm-parameters-to-salesforce-campaigns/
Find more great Pardot articles at www.salesforceben.com/the-drip/
Pardot Experts Blog
We have categorized all the different Pardot articles by topics.
Pardot Topic Categories
- Account Based Marketing (ABM) (7)
- Business Units (14)
- ChatGPT / AI (3)
- Completion Actions (5)
- Connectors (10)
- Custom Redirects (4)
- Data Cloud (2)
- Demand Generation (8)
- Dynamic Content (6)
- Einstein Features (12)
- Email Delivery (17)
- Email Open Rates (3)
- Pardot A/B Testing (2)
- Email Mailability (16)
- Do Not Email (1)
- Double Opt-in (2)
- Opt Out / Unsubscribe (14)
- Email Preferences Page (6)
- Engagement Studio (16)
- Industries (1)
- Non Profit (1)
- Landing Pages (9)
- Lead Generation (1)
- Lead Management (13)
- Lead Routing (3)
- Lead Scoring (16)
- Leads (3)
- Marketing Analytics – B2BMA (9)
- Marketing Automation (1)
- Marketing Cloud (3)
- Marketing Cloud Account Engagement (4)
- Marketing Cloud Growth (2)
- New Pardot Features (6)
- Opportunities (2)
- Optimization (2)
- Pardot Admin (64)
- Duplicates (1)
- Marketing Ops (1)
- Pardot Alerts (1)
- Pardot API (2)
- Pardot Automations (3)
- Pardot Careers (12)
- Pardot Certifications (4)
- Pardot Consulting (1)
- Pardot Cookies (3)
- Pardot Custom Objects (3)
- Pardot Email Builder (8)
- Pardot Email Templates (9)
- HML (6)
- Pardot Events (16)
- Pardot External Actions (1)
- Pardot External Activities (4)
- Pardot Forms (29)
- Form Handlers (8)
- Pardot Integrations (20)
- Data Cloud (1)
- Slack (1)
- Pardot Lead Grading (5)
- Pardot Lead Source (2)
- Pardot Lightning (1)
- Pardot Migration (1)
- Pardot Nurture / Drip Campaigns (1)
- Pardot Personalization (3)
- Pardot Profiles (1)
- Pardot Releases (18)
- Pardot Sandboxes (2)
- Pardot Segmentation (5)
- Pardot Strategy (7)
- Pardot Sync (2)
- Pardot Sync Errors (1)
- Pardot Tracker Domains (5)
- Pardot Training (3)
- Pardot Vs Other MAPs (4)
- Pardot Website Tracking (2)
- Reporting (22)
- Salesforce and Pardot (31)
- Marketing Data Sharing (2)
- Pardot Users (3)
- Salesforce Automation (5)
- Salesforce Flows (2)
- Salesforce Campaigns (20)
- Salesforce CRM (3)
- Record Types (1)
- Salesforce Engage (3)
- Salesforce Queues (2)
- Security and Privacy (1)
- Tags (3)
- The Authors (504)
- Cheshire Impact (9)
- Greenkey Digital (51)
- Invado Solutions (37)
- Jenna Molby (9)
- Marcloud Consulting (6)
- Nebula Consulting (60)
- Pardot Geeks (44)
- Salesforce Ben | The Drip (235)
- SalesLabX (3)
- Slalom (4)
- Unfettered Marketing (46)
- Uncategorized (1)
- Website Tracking (2)
- Website Search (1)
More Pardot Articles
See all posts
This Pardot article written by:
Salesforce Ben | The Drip
Lucy Mazalon is the Head Editor & Operations Director at Salesforceben.com, Founder of THE DRIP and Salesforce Marketing Champion 2020.
Original Pardot Article: https://www.salesforceben.com/the-drip/how-to-attribute-utm-parameters-to-salesforce-campaigns/
Find more great Pardot articles at www.salesforceben.com/the-drip/