Tracking Gravity Forms Thank You Pages in HubSpot: A Community Solution
Integrating Gravity Forms with HubSpot is a powerful way to capture leads and manage customer data. But what happens after someone submits a form? Often, you'll want to track which thank you page they land on, especially if you're using conditional confirmations. A HubSpot Community member recently asked how to send the thank you page URL to HubSpot when a Gravity Form is submitted. Let's dive into the solutions that were offered.
The Challenge: Capturing the Thank You URL
The original poster wanted to capture the specific thank you page URL a user sees after submitting a Gravity Form. They tried using the {embed_url} merge tag, but this only returns the URL of the page where the form is embedded, not the confirmation page.
Solutions from the HubSpot Community
Several helpful suggestions emerged from the community discussion:
1. Mapping Form Fields Directly to HubSpot Properties
One respondent suggested skipping the URL capture altogether. Instead, map the form fields that determine the thank you page routing directly to HubSpot custom contact properties. For example, if a "Resident = Yes" field determines that a user sees a specific thank you page, map that field to a HubSpot property. This way, you indirectly know which thank you page they saw based on the property value.
2. Using HubSpot Workflows to Track Page Views
Another approach involves using HubSpot workflows. This method leverages the HubSpot tracking code, which should already be installed on your WordPress site (including the thank you pages). Here's how it works:
- Create a Custom Property in HubSpot: This property will store the thank you page information (either the URL or a descriptive label).
- Identify Your Thank You Page URLs: List all the possible thank you page URLs.
- Build a Workflow for Each Thank You Page: Create a separate workflow for each thank you page. Each workflow will:
- Trigger when a contact views that specific page.
- Update the custom property to reflect the page type.
Here’s a more detailed breakdown of creating the workflow:
- Create a new workflow in HubSpot under Automation > Workflows. Choose "Start from scratch".
- Set the enrollment trigger to “Contact views a page” (under “Web activity”).
- Add a condition: Page URL contains a specific part of the thank you page URL (e.g.,
/thank-you-resident/) or is exactly the full URL. - Add an action to update the custom property you created. Set the value to something meaningful, like “Resident” or the full URL of the thank you page.
- Review and turn on the workflow. Make sure it’s set to automatically enroll contacts.
One community member shared a helpful step-by-step implementation guide:
- HubSpot Tracking Code Installed
- Gravity Forms Connected to HubSpot
- HubSpot Account with Workflows Access
And here is the step-by-step implementation:
- Create a Custom Property in HubSpot
- Identify Your Thank You Page URLs
- Build a Workflow for Each Thank You Page
- Test the Integration
3. Custom PHP Snippet (Advanced)
For those comfortable with code, a more advanced solution involves using a PHP snippet with Gravity Forms' gform_after_submission hook. This allows you to check the form entry values, determine which confirmation matches, and then push the URL to HubSpot via the API. However, this method is generally more complex than the workflow approach.
ESHOPMAN Team Comment
The HubSpot Community's solutions highlight the flexibility of HubSpot's workflow engine. While a direct merge tag for thank you URLs would be ideal, the workflow approach provides a robust workaround. We at ESHOPMAN believe that mapping form fields to HubSpot properties offers a simpler, more maintainable solution for many use cases, especially when dealing with multiple conditional thank you pages. For those seeking deeper integration, exploring ESHOPMAN’s built-in e-commerce for HubSpot might provide a more streamlined solution.
Ultimately, the best approach depends on your specific needs and technical expertise. The workflow solution offers a good balance of power and ease of implementation. By leveraging HubSpot's tracking code and workflow automation, you can effectively track which thank you pages your leads are visiting, providing valuable insights into their journey.