Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Page title in Hubspot Form integration context data #2029

Closed
umkasanki opened this issue Aug 17, 2024 · 7 comments
Closed

Add Page title in Hubspot Form integration context data #2029

umkasanki opened this issue Aug 17, 2024 · 7 comments

Comments

@umkasanki
Copy link

What are you trying to do?

If I try to submit a HubSpot form via the Formie integration, I only see the url in the results table. It looks like the form page title is not being added to the context when the form is submitted.
изображение

What's your proposed solution?

Could you please add the form page title to the HubSpot context as provided in the Forms API??

  "context": {
    "hutk":"hutk", // include this parameter and set it to the hubspotutk cookie value to enable cookie tracking on your submission
    "pageUri": "www.example.com/page",
    "pageName": "Example page"
  },

https://legacydocs.hubspot.com/docs/methods/forms/submit_form_v3_authentication#:~:text=As%20this%20API%20is%20authenticated%2C

Result:
изображение

Thanks

Additional context

No response

@engram-design
Copy link
Member

We already automatically include the pageUri but as for the pageName that's a little trickier.

It's not something we can map in the form integration settings without having it map to a Hidden field that you'd populate with the entry's title when rendering the form.

We could maybe scrape it from the referrer's meta title, but I'd rather not add that sort of overhead.

In Formie 3 for Craft 5, you'll be able to use PHP events in a module to add this sort of thing as context variables for the integration, to send along with the payload.

For now, I've added "Page Name" and "Page URI" to the mapping interface where you can handle all this through hidden fields, and populate them in your templates.

Updated for the next release. To get this early, run composer require verbb/formie:"dev-craft-4 as 2.1.26".

@umkasanki
Copy link
Author

For now, I've added "Page Name" and "Page URI" to the mapping interface where you can handle all this through hidden fields, and populate them in your templates.

Excellent. Thank you very much!

@umkasanki
Copy link
Author

Hello @engram-design

Checked. Works.
But with this implementation the client gets the following warning in the HubSpot account.
This value wasn't passed to the Contact record. 'pagename' isn't a Contact property.

изображение

Looks a bit dirty.
Maybe there is another, more beautiful way to pass the form page title to the context?

@umkasanki umkasanki reopened this Aug 26, 2024
@engram-design
Copy link
Member

Ah, that's my mistake not removing them from the mapping of the contact object. Updated for the next release. To get this early, run composer require verbb/formie:"dev-craft-4 as 2.1.26".

@umkasanki
Copy link
Author

I still get this warning((.

HubSpot submission:
изображение

Form mapping:
изображение

Update is installed:
изображение

@engram-design
Copy link
Member

Should have double-checked that, sorry. Updated for the next release. To get this early, run composer require verbb/formie:"dev-craft-4 as 2.1.26".

@engram-design
Copy link
Member

Fixed in 2.1.27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants