- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Identify Tracking method not updating custom property
SOLVESep 20, 2019 3:57 PM
Hello!
I'm trying to identify and create a contact using the following code:
var _hsq = window._hsq = window._hsq || []; _hsq.push(["identify",{ email: emailAddress, onscale_ip_country: ip_location.country_name, onscale_ip_country_code: ip_location.country, onscale_ip_state: ip_location.region, onscale_ip_state_code: ip_location.region_code, onscale_ip_city: ip_location.city, onscale_ip_timezone: ip_location.timezone }]); _hsq.push(['trackPageView']);
I have created the custom onscale IP properties, however, I have not been able to update them for a newly created contact, nor have I been able to track the contact's lead (Organic Search, keywords, direct traffic, etc.).
The previous code I used was the following:
var _hsq = window._hsq = window._hsq || []; _hsq.push(["identify",{ email: emailAddress }]); _hsq.push(['trackPageView']);
This created the contact and tracked the lead properly, however, no IP location information was captured.
I should be able to pass in these custom properties (strings) according to the API guide here: https://developers.hubspot.com/docs/methods/tracking_code_api/identify_visitor
What am I missing with this implementation? I have casted the ip variables to strings as well. It seems as if adding custom properties makes the entire identify invalid.
Any help would be greatly appreciated.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Accepted Solutions
Sep 22, 2019 10:28 PM
Hi @OnScaler,
I hope all is well with you 😄
I was able to create a new contact with the custom properties on one of your landing page:
In this case, I would expect the custom properties to be pass across if there's a value to it. Could you try passing in a testing variable onto the custom properties and see if it gets sent through? I'm not too sure how the ip_location is getting the user's location information, you can also try printing that out and check what's the value being passed across.
Additionally, I noticed there's a few IP address being included in your 'Exclude traffic' settings. Do take note that:
Once an IP address or referrer domain has been added to your excluded traffic, no visits, page views, submissions, or events data originating from that IP address or domain will be recorded in your HubSpot analytics.
Referencing this documentation: Exclude traffic from your site analytics
Let me know how it goes!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content