I want to know what traffic source (organic, paid, email marketing, etc.) is responsible for generating a form submission. This data needs to be tied to the Contact record, updated at or around the time of a form submission.
hs_original_traffic_source isn’t dependable due to our oldest Contact records being imports, or from too long ago.
hs_latest_traffic_source gets overwritten with each new session.
I’ve created traffic_source_at_time_of_submission, and set up a workflow triggered by ANY FORM SUBMISSION that looks like the screenshot below. *
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Important note: This branch checks if hs_latest_traffic_source HAS BEEN UPDATED in the last 1 day. Otherwise, hs_latest_traffic_source was coming up empty at times, therefore copying null over to traffic_source_at_time_of_submission.
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~*
Great. Now we’re able to capture the hs_latest_traffic_source for the session at the time when a web visitor actually submitted one of our lead forms.
So… How can we retroactively fill this value for hundreds of thousands of contacts?
Workflows cannot dig through property history for hs_latest_traffic_source and grab its latest value prior to recent_conversion_date.
I’ve considered writing a NodeJS application to do just that… but I’ve since realized that this logic has the same issue as the one described in my important note above. hs_latest_traffic_source isn’t always set at the time when the form is submitted, and often takes time to be calculated–hence the two minute delay in my workflow.
