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!
