Marketing Attribution: How To Find Signal In The Noise With AI [Code Included]
Make "How did you hear about us?" actionable in HubSpot
What’s working?
Where should we be doubling down?
How confident are we in our budget allocation?
Let’s face it – every marketer business is trying to answer these 3 questions right now, and attribution is stuck squarely in the thick of it.
Whichever attribution methodology you follow - first touch, last touch, self-reported, the fancy AI-powered one, remember…
Your attribution data is only as good as its ability to inform what action to take or what change in strategy you should make.
Today we’re digging into how to extract signal from the noise of open responses to the popular “How did you hear about us?” question for self-reported attribution.
Using AI to categorize unstructured text
You might have heard this sentiment before:
“If you use a dropdown for self-reported attribution…you’re missing the most valuable insights.”
Capturing open text responses is the best way to get unfiltered insight from your prospects and customers. But it can create a giant data management (and usefulness) headache if you don’t have a way to find the patterns that relate to the business problems you want to solve.
Previously, you might have created a workflow in HubSpot with complicated text “contains any of” type logic branches which are at best inconsistent at correctly identifying the meaning of unstructured responses.
Fortunately it’s 2024 and beyond the speculative AI demos lie practical business use cases that can both save us time, and do the job more effectively.
See the prompt below as an example:
When a user signs up on our website and responds to the question "How did you hear about us?", categorize their open text response into one of the following predefined categories:
Organic Social (e.g., Facebook, Twitter, Instagram, LinkedIn)
Organic Search (e.g., Google, Bing)
Paid Ads (e.g., Google Ads, Facebook Ads)
Referral (e.g., another website, blog, influencer)
Online Events
Example Responses and Categorization:
Response: "I saw an ad on Facebook" ➜ Category: Organic Social
Response: "My friend told me about your website" ➜ Category: Referral
Response: "Found you on Google search" ➜ Category: Organic Search
Using the prompt above, categorize this response: "{{ contact.how_did_you_hear_about_us }}"
A categorization prompt like this has all sorts of interesting applications for structuring messy CRM data. Let’s use it in a real example to organize open text form submissions into a dropdown property for easier reporting in HubSpot.
Step-by-step automatically categorization self-reported attribution data in HubSpot
Extract signal from the noise of self-reported attribution 🎯
Will your attribution ever be perfect? Unlikely…
Can your attribution be a more helpful guide? Probably…
💡 Using AI to automatically categorize messy “How did you hear about us?” answers can be a huge time saver and is typically much more effective than some crazy branching using “text contacts” logic.
Here’s 2 step-by-step ways to categorize your attribution data in HubSpot:
1. Add a “How did you hear about us?” field
🏷 Add a single line text property “How did you hear about us?” to your HubSpot contact records.
📆 Whether you’re using a contact form that redirects to a meeting scheduling page or have demo scheduling embedded directly on your site add the new property as a required field.
☎️ If you do not capture a response before the demo call, add the “How did you hear about us?” question to your demo scripts and playbooks and either ensure reps fill in the field manually or extract the customers answers from your call recordings.
2. Create an automated workflow
Extract signal from the noise of self-reported attribution 🎯
Will your attribution ever be perfect? Unlikely…
Can your attribution be a more helpful guide? Probably…
💡 Using AI to automatically categorize messy “How did you hear about us?” answers can be a huge time saver and is typically much more effective than some crazy branching using “text contacts” logic.
First – using Zapier
Step 1: New Contact Property Change in HubSpot
🎯 App & Event: “New Contact Property Change” in HubSpot.
🔌 Select Account: OAuth the HubSpot account you’d like to use.
⚡️ Action:
→ Choose your “How did you hear about us?” contact property as the property to watch for changes.
→ Make sure you add your “How did you hear about us?” contact property as an additional property value to retrieve.
Step 2.Send Prompt in OpenAI (GPT-4, DALL-E, Whisper)
🎯 App & Event: “Send Prompt” in OpenAI (GPT-4, DALL-E, Whisper)
🔌 Select Account: Add the API Key and Organization ID for the OpenAI account you’d like to use.
⚡️ Action:
→ Select the OpenAI Model you would like to use (make sure you review the specific pricing before running your Zap)
→ Add your prompt - make sure you use Zapier’s “Insert Data” functionality to dynamically include the value of your “How Did You Hear About Us?” HubSpot property in the prompt for evaluation.
When a user signs up on our website and responds to the question "How did you hear about us?", categorize their open text response into one of the following predefined categories:
Organic Social (e.g., Facebook, Twitter, Instagram, LinkedIn)
Organic Search (e.g., Google, Bing)
Paid Ads (e.g., Google Ads, Facebook Ads)
Referral (e.g., another website, blog, influencer)
Online Events
Example Responses and Categorization:
Response: "I saw an ad on Facebook" ➜ Category: Organic Social
Response: "My friend told me about your website" ➜ Category: Referral
Response: "Found you on Google search" ➜ Category: Organic Search
Using the prompt above, categorize this response: "{{ contact.how_did_you_hear_about_us }}"
Optionally, you can also fine tune how your prompt is evaluated by the OpenAI model by editing the values for:
Temperature: Default is 0.7. Higher values mean the model will take more risks. Try 0.9 for more creative applications, and 0 for ones with a well-defined answer.
Max Length: The maximum number of tokens for the completion.
Stop Sequences: Up to 4 sequences where the API will stop generating further tokens.
Top P: An alternative to sampling with temperature, called nucleus sampling
Frequency Penalty: Default is 0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
Presense Penalty: Default is 0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
Step 3: Update Contact in HubSpot
🎯 App & Event: Update Contact in HubSpot
🔌 Select Account: OAuth the HubSpot account you’d like to use.
⚡️ Action:
→ Object ID: Use the HubSpot ID from the “New Contact Property Change in HubSpot” step.
→ Set the “Contact Info: Self-Reported Source” property to the value returned in step 2, “Send Prompt in OpenAI (GPT-4, DALL-E, Whisper)”
→ Set the “Contact activity: Self-Reported Source Last Updated” property to {{ zap_meta_timestamp:UNIX }}
Second – using a custom coded action in a contact based HubSpot workflow (code included)👇
Keep reading with a 7-day free trial
Subscribe to ConnectedGTM to keep reading this post and get 7 days of free access to the full post archives.