Prerequisites
1. HubSpot Tracking Code Installed
If you’re using the official HubSpot WordPress Plugin, the tracking code is automatically added to all pages.
Alternatively, you can manually add the tracking code to your theme’s header.php or via a third‑party plugin.
Make sure your thank you pages are also tracked (they usually are if the code is site‑wide).
2. Gravity Forms Connected to HubSpot
You need a way to associate form submissions with HubSpot contacts.
The easiest method is using the HubSpot WordPress Plugin – it creates contacts when forms are submitted (provided an email field is present and mapped).
Alternatively, you can use Gravity Forms’ native HubSpot add‑on or a third‑party integration like Zapier.
3. HubSpot Account with Workflows Access
Workflows are available in Marketing Hub Professional and Enterprise, or Sales Hub Professional and Enterprise.
If you have a lower tier, you may need to upgrade or use the PHP solution instead.
Step-by-Step Implementation
1. Create a Custom Property in HubSpot
This property will store which thank you page the contact saw (or the exact URL).
In your HubSpot account, go to Contacts > Settings (gear icon) > Properties.
Click Create property.
Object type: Contact
Name: e.g., “Thank You Page Type” (or “Thank You Page URL”)
Internal name will auto‑fill – note it down (e.g., thankyoupagetype).
Field type: Choose Single‑line text (if you want to store the URL) or Dropdown (if you prefer a readable label).
Save the property.
2. Identify Your Thank You Page URLs
List the exact URLs (or URL patterns) for each conditional thank you page.
Examples:
etc.
You’ll use these in the workflow conditions.
3. Build a Workflow for Each Thank You Page
You’ll create one workflow per thank you page. Each workflow will:
Trigger when a contact views that specific page.
Update the custom property to reflect the page type.
Example Workflow for the “Resident” Thank You Page:
1. Create a new workflow
Go to Automation > Workflows.
Click Create workflow and choose Start from scratch.
2. Set the enrollment trigger
Trigger: “Contact views a page” (under “Web activity”).
Condition: Page URL contains /thank-you-resident/ (or is exactly the full URL).
This ensures only contacts who land on that specific thank you page are enrolled.
3. Add an action to update the property
Click the + icon and choose Set property value.
Select the custom property you created (e.g., “Thank You Page Type”).
Set the value to something meaningful, e.g., Resident or the full URL.
Save the action.
4. Review and turn on the workflow
Name your workflow (e.g., “Set Thank You Page – Resident”).
Make sure it’s set to Automatically enroll contacts.
Turn it on.
Repeat the same steps for each conditional thank you page, adjusting the URL condition and property value accordingly.
5. Test the Integration
Submit a test entry through your Gravity Form and land on one of the thank you pages.
Go to the contact record in HubSpot (find the test email).
Check the “Thank You Page Type” property – it should now contain the value you set (e.g., “Resident”).
Also, the contact’s timeline will show the page view event.
How It Works (Behind the Scenes)
1. User submits the Gravity Form.
2. HubSpot’s tracking code captures the form submission and creates/updates the contact (if email is provided and the integration is active).
3. The user is redirected to the conditional thank you page.
4. HubSpot’s tracking code sends a page view event for that thank you page.
5. The workflow detects the page view, matches the URL condition, and updates the custom property.
All of this happens in near real‑time, though there may be a slight delay (usually a few seconds) while HubSpot processes the events.