Deploy a 'Before registration' hook in Strivacity which can retrieve contact information from HubSpot and perform data comparisons before allowing users to register.
In our example integration, we will be doing comparisons based on the email domains which users have registered in HubSpot. Only existing domain values will be allowed to register.
- Basic understanding of HTTP request/response flows
- Web application development experience
- HubSpot custom integration developer tenant
- Familiarize yourself with HubSpot's API-client package
- HubSpot API key. Find more information about the API key in HubSpot’s knowledge base.
If your admin account is unable to retrieve an API key, you may need to first provision a HubSpot "test account", and use the test account's API key.
- Sample contacts in your developer tenant.
At least one sample contact with an email value is required.
Two sample contacts are added automatically for you when registering a HubSpot developer tenant. Please review these contact details or create your own test contacts before proceeding.
- A Strivacity tenant for testing
- Identity Store supporting 'EMAIL' identifiers
- An application in your Strivacity tenant to apply and test the Lifecycle Event Hook
- Select 'Custom integration' on the HubSpot developers' page.
- Before you continue, you will be directed to HubSpot’s guide about how to obtain the API key of your tenant.
Capture the API key for future use.
- Follow HubSpot's onboarding process.
- Check 'Contacts' for your example customers.
Optional You may add additional contacts to test use cases not covered in this example.
Our plugin library contains an off-the-shelf HubSpot event hook template that jumpstarts your integration process and allows you to customize it to your needs.
- In the Admin Console, go to Lifecycle Event Hooks.
- Click ' Add plugin'. You will be redirected to the plugin library.
- Click on the HubSpot logo. You can find it in the CRM section.
- There will be a pre-select for the event hook, so you only need to click 'Add'.
- Wait for the HubSpot hook template to be added.
If the Admin Console doesn't want to add the hook, it's most likely that the name of the hook is already taken. Click 'Edit' and you can modify the name of the event hook. Then continue with 'Try again'.
- If the hook has been successfully added, you can return to the list view with 'Back to plugin library', then 'Back to event hooks'.
- Select the HubSpot event hook you've just added.
- In editor view, click on the cube icon on the top left corner of the IDE panel.
- Click 'Add dependency'.
- Search for and add the following packages:
This should appear in the dependencies list on the left.
Beta packages may not be stable. For best results use the latest stable package versions.
- At HUBSPOT_APIKEY, replace '_api__key' with the API key you have obtained from your HubSpot tenant.
- Click 'Save'. You can return to the event hooks with the 'Back to event hooks' button.
Your hook's status will stay Non-Deployed until you add it to an application.
- Go to Applications and click 'Create Application'.
- Add a name, description, and define the mandatory properties of the application.
- Ensure the Identity Store supports the 'EMAIL' identifier.
- Scroll down to Lifecycle Event Hooks and assign your 'Before registration' hook to your Strivacity test application to integrate with HubSpot.
- Save your changes.
Copy the test application's self-service URL.
- Go to an incognito browser.
Make sure only one incognito window is open as multiple windows share session information.
- Go to the self-service portal of the Strivacity application.
- Try to sign up as a customer who has the same email address domain as one of your Hubspot contacts.
According to our example hook, this customer will be allowed registration.
- Try to sign up as a customer whose email address isn't among your Hubspot contacts.
According to our example hook, this customer will be denied registration.
Implement additional logic for customers denied registration.
Updated 3 months ago