Identify method not updating non email contact properties
SOLVE
I am attempting to update contact properties using _hsq.push(["identify"]) as documented but I am finding that it will only create contacts and add email, other properties are ignored.
I tried a few times to create contacts with firstname and lastname values through the console, but this record was only created upon completing step 7. The same code executed perfectly on my own site's console...
I'm not quite sure what's going on there, but I'd like to explore alternatives for a second. Is there a reason why you're attempting to use the identify function instead of the Forms API? On the surface, the Forms API seems like a much better fit for the kind of information you're gathering and trying to pass to HubSpot.
To be transparent, I'll be heading on vacation shortly, so I may miss your responses. While I'm out of office next week, my teammates @Derek_Gervais and @Connor_Barley will be keeping an eye on my ongoing threads.
My most recent test went through successfully! Here is the resulting contact record.
Are you testing on an unfiltered IP?
If you're using your normal browser on your organization's network or VPN, the analytics events are likely being excluded from your account. Whenever I test HubSpot analytics functionality, I use Opera in VPN mode.
Nope, the Forms API doesn't require any authentication. You can just gather the desired field values, format them into JSON, and shoot them to the endpoint. You will need to create a HubSpot "copy" of your Squarespace form with a unique formGuid to receive these submissions.
However when I insert the variables (see image below), nothing happens.
I'm simply trying to implement shopping cart abandonment mitigation with a workflow in Hubspot. I just need to push the data (name, email, page visited, etc.) from the external platform into Hubspot.
The external platform is not using a Hubspot form, and the HS tracking script is on every page of the external platform.
Here's a snapshot of the script in the external platform... 2 steps... Contact Info (page 1) and Payment Info (page 2)
Can you tell me a bit more about the variables you're using? Are they Handlebars.js variables? If you log those variables to the console within those "Checkout Scripts" snippets, do they populate with known values?
(HubSpot's HubL templating language also uses the {{variable}} syntax, so I want to be sure that's not what you're trying to do.)
In the Network tab on the checkout pages, do you see any GET requests to https://track.hubspot.com/__ptq.gif? If so, can you share sample request URLs below? The information passed in the identify function should populate an i parameter like the example below for "Aaron Burr":
Identify method not updating non email contact properties
SOLVE
Thanks for sharing all this information, @randyCg!
Based on your description of the issue, I suspect the variables aren't populating the email and other property values by the time the identify function triggers. (The inspector may not be telling the full story in real time.)
Do you mind if I run some tests too?
Depending on what I find, we may need to reach out to Thought Industries. They document and recommend the use of these Handlebars.js and HubL-like variables but the article doesn't say exactly how and when they're filled.
My tests consistently yielded these values. When unencoded a second time, they are:
email=test3@HSQ1.com
firstname=Step 2
lastname=Payment Info
These are not the values which I submitted in the form, so there is some disconnect between what is being typed and what is being sent in the identify function.
Does the test3@HSQ1.com email ring a bell? Could it be hard coded anywhere else on your site?
Finally, I tried to inspect both the "Contact Info" page shared above and the page I land on after submitting it to locate the identify function with the variables filled, but I'm not seeing it. Can you walk me through exactly how you reached this view?
May 21, 202010:47 AM - edited May 21, 202010:54 AM
Member
Identify method not updating non email contact properties
SOLVE
Hi Isaac,
I was running various tests last night, looking at the inspector. My last test was a hardcoded test using the email test3@hsq1.com, and it did end up appearing in contacts.
I just switched the JS back to
<script>
var _hsq = window._hsq = window._hsq || [];
_hsq.push(['identify', {
email: '{{email}}',
firstname: '{{firstName}}',
lastname: '{{lastName}}'
}]);
_hsq.push(['trackPageView'])
</script>
If you could try your tests again, I'm going to do the same.
My most recent test went through successfully! Here is the resulting contact record.
Are you testing on an unfiltered IP?
If you're using your normal browser on your organization's network or VPN, the analytics events are likely being excluded from your account. Whenever I test HubSpot analytics functionality, I use Opera in VPN mode.
Identify method not updating non email contact properties
SOLVE
Hi Isaac,
I have been able to successfully create them through my console but only after triggering an event.
I have not really explored the forms API option. Does it require authentication with OAuth? I wanted to keep our hubspot dependency on these pages as lightweight as possible.
I tried a few times to create contacts with firstname and lastname values through the console, but this record was only created upon completing step 7. The same code executed perfectly on my own site's console...
I'm not quite sure what's going on there, but I'd like to explore alternatives for a second. Is there a reason why you're attempting to use the identify function instead of the Forms API? On the surface, the Forms API seems like a much better fit for the kind of information you're gathering and trying to pass to HubSpot.
To be transparent, I'll be heading on vacation shortly, so I may miss your responses. While I'm out of office next week, my teammates @Derek_Gervais and @Connor_Barley will be keeping an eye on my ongoing threads.
Identify method not updating non email contact properties
SOLVE
Hi Isaac, thank you for connecting!
I'm just getting into JS, so I'm not yet completely up to speed on it. I'm not doing anything with handlebars.js. I was given these 2 boxes in the external platform where they trigger on a page visit, where I can send data via JS to HubSpot.
You can see those 2 boxes and my JS code in each one.
When I visit the site, and select a course to purchase... I fill out my contact information on page 1, and then proceed to the credit card page... and abandon the cart.
It's at that moment that the script should fire off and send the information to Hubspot.
I don't see a URL as you've spec'd... only the shopping cart URL
Identify method not updating non email contact properties
SOLVE
Also Isaac, just realized that our production code does not include first and lastname fields. I have been testing by dropping your examples into the console until I can get this working. You should be able to do the same on that step or even the first step since the hubspot tracking script is loaded on every page.
The url where this is active is https://my.collegevine.com/start, you can go through the wizard with dummy data if you'd like for testing purposes. The event is sent to hubspot after Step 7 / email address entry when next is hit.
Could you share a link to a page with this code on it that I could test? Additionally, could you send me a link to that contact record (or a similar one showing the issue)?
Identify method not updating non email contact properties
SOLVE
I've just modified my code based on the example you've provided with no luck. I am sending firstname and lastname and neither get updated. Also in your example there was no trackEvent, but contacts won't update on my end without sending a trackEvent. Is there anything specific to my account or setup that could be happening here?
In your test code, you've placed the email value within double quotes while the firstname property value is in single quotes. I wonder, if you only use single quotes, does it make a difference?
Also, would you mind trying to place var _hsq = window._hsq = window._hsq || []; just before the identify method?