Not able to track page views from my site on contact timeline in Hubspot

contacts

#1

Hello there,

I am using forms API of Hubspot to submit forms data from my site to Hubspot and currently testing it in development environment. Contact is getting created properly in Hubspot but there are no page views shown on contact’s timeline though I am passing hubspotutk cookie in hutk parameter inside hs_context json blob while submitting forms data to Hubspot forms API. Page urls for pages viewed by that contact are shown on “Page Performance” page (with tag as External) but not on contacts timeline.

Is it something to do with development account? or am I missing something? I have also checked IP filtering section in “Report Settings” but my IP isn’t added in textarea give to add IP’s to exclude traffic from, it is only listed at top below title “Your IP address is:” .

Any help would be highly appreciated.

Thank you.


#2

@TusharTitame

Can you post an example of your post body for your form submission?

thanks


#3

Hello @pmanca ,

Thank you for your help. Following is the base url and post body including my few form fields and hubspot cookie -

base url - https://api.hubapi.com/uploads/form/v2/:portal_id/:form_guid?hapikey=:key

post data body - “first_name=Abc&last_name=Xyz&email=test.email%40test.com&hs_context[hutk]=asa433ew6eb7ye32dsd332”

Let me know if you need any other details of implementation.

Thanks


#4

@pmanca,

Just FYI - I am able to see property named hs_context_utk_ in updated properties list on contact created by form submission but no page views are shown. Also please note that my site name starts with subdomain for each user. So suppose in Hubspot my site is set as mysite.com but when user visits it after signup it is like usersubdomain.mysite.com/page_1 , usersubdomain.mysite.com/page_2 etc

Also, my site is totally independent. Does pages needs to be part of Hubspot to get their views tracked on contact profile ? Not sure if something like that is an issue so thought to mention.


#5

@TusharTitame

Are you JSON encoding your hs_context?


#6

@TusharTitame and @pmanca I am having similar issues. Passing data through the form api and contact is properly created but no page tracking. Did you discover a fix or perhaps have a tip? Thanks in advance!


#7

Yes @pmanca , yes it worked after JSON encoding hs_context parameter . Thank you :slight_smile:

@Brendan_Gilbert , try JSON encoding your hs_context parameter which you pass along with form parameters. As I am using ruby I added json encoded hs_context parameter to my form parameters before submitting them to Hubspot as shown in following example. After this it started tracking page views on contact based on passed hutk value which is hubspotutk cookie value from user’s browser cookies -

Example -
{ “hs_context” => { “hutk” => “1v25djgjkvnr75nfk58fk”, “ip_address” => “0.0.0.0” }.to_json }

Note - passing IP address is not necessary for tracking page views on contact.