Skip to main content

Send an event

You should now turn your attention to the server. First, check you are now receiving a probe_id along with any other details you want to send along with the event (email, phone, etc.).

Not receiving the probe_id field?
  1. Inspect the HTML of the form, can you see the agent code? If not, check it's deployed properly.
  2. If you're using our convenience method (option 1) check that the form field has the data-hp-site-key="<INSERT_SITE_KEY>" attribute and of course that it's within the <form></form> tags.
  3. Double check the site key is correct.
  4. If you have a CSP (Content Security Policy), did you add Hitprobe's domains to it in the previous step?

Now you have the probe_id, go ahead and send it to the event API along with (optionally) any other details about the visitor you want to include.

curl 'https://app.hitprobe.com/api/v1/event' \
-H 'Content-Type: application/json' \
--data '{
"email": "[email protected]",
"probe_id": "<INSERT_PROBE_ID>",
"ip": "<INSERT_REMOTE_IP>",
"secret_key": "<INSERT_SECRET_KEY>"
}'

The payload should be a JSON object containing the probe_id, the remote IP address (i.e. the user's IP), your secret key, and the details the user provided.

For example:

{
"probe_id": "ctwCYFyAUteNpsBgAw7xYL",
"email": "[email protected]",
"name": "Dan Gerous",
"phone": "(212) 664-7665",
"ip": "204.158.96.40",
"address": {
"address1": "35 Lodgeville Rd",
"address2": "",
"city": "",
"state": "Minnesota",
"country": "US",
"postal_code": ""
},
"secret_key": "3748eaee-7408-4fee-9e42-4d5d94e5f2e9"
}

We'll look at each of the properties in the JSON payload next.

info

All the fields are optional, but of course for best results you'll want to provide as many data points as possible. If you prefer, you can provide only the probe_id to get only device info, or just an ip and email if you only need to check the IP and email address. It's up to you.

Secret key

You'll find the secret key under the site's settings in the console.

Probe ID

Send the probe_id generated by the client-side agent. The API will accept empty or malformed IDs at this point but will mark them as invalid in the result.

IP address

The IP address should be the remote server IP address (i.e. the end-user's public IPv4 or IPv6 address). Providing an IP address is helpful as it allows the integrity of the probe data to be checked, and acts as a fallback if the probe is not valid.

info

See our additional information about capturing IP addresses, as proxies can have an impact on how you collect the IP.

Email and name

Provide the email address and full name of the customer.

Phone

The customer's phone number, in any format.

Hitprobe will try to coerce any phone number string into E.164 (international) format. For locally formatted numbers, it will use the site's country (in site settings) to do this accurately.

Address

Provide an address object using any or all of the keys in the address property. The input is essentially freeform. Hitprobe will attempt to parse and normalise the address.

More information

Remember, this is a shortened guide to help you get started. You can skip to full details about the API request now if you prefer.