How to grab value from custom JavaScript event?


#1

We created a new custom JavaScript event to capture the page URL that a user is on when they see a modal. We’re seeing plenty of completions in the event report, but we can’t figure out how to grab the value passed through via the custom JS (see code below). We don’t even care who the user is, we just need to know that page URL. Is the value hiding in the report somewhere, or are we going about this the complete wrong way?

if ($('#redirect-alert-modal').length > 0) {
	$('#redirect-alert-modal').on('show.bs.modal', function (e) {
		hsq.push(["trackEvent", {
			id: "000000969665",
			value: window.location.href
		}]);
	});
}

#2

Someone at HubSpot can correct me if I’m wrong, but I believe the value property is reserved for revenue data only and has to be a decimal value.

From the docs:

_hsq.push(["trackEvent", {
    id: event_id,
    value: event_revenue_value
}]);

The value is an optional parameter. Use this if you have a specific dollar amount of revenue associated with completion of this event.

With something like Mixpanel’s events API, you can track an event and toss in custom properties. Seems as though HubSpot limits you to the event ID and a revenue amount.


#3

I think you’re right @rsobers! Thanks for pointing that out.