The source for all contacts being created via a form submission is set to “Direct Traffic”. Looking at other topics on this issue has been helpful, but I’m still not sure why that’s the case in our app.
We have cross-domain tracking enabled on our marketing site domain and app domain, with the tracking code installed on both. I can see that the value for the hutk cookie is being set correctly to the same value in my browser on both domains.
For my test, I did the following:
Deleted all cookies for both the marking site domain and app domain
Performed a search on Google for the name of our app. Google showed our marketing site in the results
Clicked on the marketing site in the Google search result
From the marketing page, clicked on the link to start a trial, which redirects the user to the app
Completed the trial workflow in the app, which submits a form request to Hubspot on the last step of the workflow.
Looking over the form submission, I can see that the value for hutk, pageName, and pageUrl were all submitted correctly. I’ve attached a screenshot showing this.
However, the source for this test contact is still showing as “Direct Traffic”.
I have a feeling that the contacts weren’t merged properly, because when looking up the associated contacts by utk in the Hubspot API by email addresses, I see what looks like two different contacts with different vid’s.
The data in the hs_context field is treated as metadata for the submission, so it should not show up in the form submission data in HubSpot. If you’re seeing entries for those items in HubSpot, there’s likely an issue with how the hs_context data is formatted in the POST request, so the data isn’t actually being processed.
Do you have an example of the POST body from one of the submissions?
@dadams, thanks for the help. I was able to resolve my issue – the problem was that I was not encoding the params as JSON properly. I’m seeing the analytics data come through now.
Manny - I’m having the same issue. Would you mind sharing your script/code? What we’re using looks right, but it’s not picking up the cookie for some reason. Everything is showing “direct traffic.” Our PHP code is here:
(note: the “@” symbol has been replaced with the text “[at]” because this forum thinks those “at symbols” are mentions of other users and there’s a limit to the number of users you can “at mention.” LOL!)