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

HubSpot Master Forms #5483

Merged
merged 51 commits into from
Jul 22, 2022
Merged

HubSpot Master Forms #5483

merged 51 commits into from
Jul 22, 2022

Conversation

bretthayes
Copy link
Contributor

@bretthayes bretthayes commented Jun 15, 2022

This closes #5409 and consolidates most of our HubSpot forms under 4 master forms that map to specific formIds. Some forms that do not fall under the master forms still use the specific formId backwards compatible syntax in the API.

Please take a look at our Master List to understand the mapping as well as the tech requirements.

Changelog

  • Converted our HubSpot hook into a component for convenient rendering in markup for both MDX and non-MDX pages. This means the old EmbeddedHubSpot component is now deprecated in favour of one component to rule them all. The new API is much more simplistic for both cases. I will follow up with a PR to update the handbook section for embedded HubSpot forms after this PR is merged.
  • Added a useLandingSource hook to grab and store the initial landing source of a user in sessionStorage. This will be used to track landing sources in our HubSpot form submission data in case the sourcegraphSourceUrl cookie doesn't contain any useful data
  • Consolidated all our contact pages in a more convenient template mapped index since they all use very similar props, content, and forms. This deprecates a lot of duplicated code into one template so we can handle contact page redesigns quicker in the future.
  • Cleaned up some broken links on our abcs ebook page
  • Updated our master forms in HubSpot to be more responsive
  • Deprecated our FormLegal component since the form legal line is now included in each master form. I think this should be the standard going forward unless we feel otherwise.
  • Also closes Investigate UTM params causing duplicate forms #5488 with some improved optimizations
  • Added meta to terms sub pages/slug template
  • Added custom form submission messages to HubSpotForms
  • GatedResourceLayout updated to allow for a custom form submission message
  • HubSpotForm form submission messages fall back with a generic message if none is provided
  • window.open removed from guides pages for more preferred UX best practice (Safari and Firefox block popups by default)
  • added tailwind whitespace utility class placeholder
  • Restricted title prop to be a string only, for our GatedResourceLayout

Test

  1. Ensure prettier has standardized the proposed changes.
  2. Ensure every page that has a form renders the correct form. Please use the Master List for reference to check each new path and check the following:
    1. The masterFormName matches
    2. If ChiliPiper is enabled/disabled
    3. The form submission message is correct
  3. Ensure every contact page renders correctly
  4. Check that form data is submitted correctly:
    1. Start a new session at a random page (landing source) and navigate to a page with a form.
    2. Ensure the anonymous_user_id hidden form field is populated with the sourcegraphAnonymousUid cookie data
    3. Ensure the first_source_url hidden form field is populated with the landing source or the sourcegraphSourceUrl if you started your session from the product and navigated to the about site through a CTA
    4. Ensure that the form_submission_source is populated with the page you're submitting the form on. Submit a test submission and ensure all pieces of data are sent and captured in your form submission on HubSpot. You can find your contact in HubSpot by searching in Contacts for the email you used in your form submission.
  5. Check that no duplicate forms render when utm params or other query parameters are present in the URL
  6. Check all pages that use our GatedResourceLayout component and ensure form submission messages with links to the resources open properly when clicked

TODO

@bretthayes bretthayes marked this pull request as ready for review June 16, 2022 15:19
@sourcegraph-bot
Copy link
Contributor

sourcegraph-bot commented Jun 16, 2022

Notifying subscribers in CODENOTIFY files for diff d96637a...a4e4401.

Notify File(s)
@content-platform-team content/terms/archives/privacy/2021-01-15.md
content/terms/archives/subprocessors/2021-12-03.md
content/terms/index.md
content/terms/privacy.md
content/terms/security.md
content/terms/subprocessors.md
netlify.toml
src/components/Blog/PostLayout.tsx
src/components/FormLegal.tsx
src/components/GatedResourceLayout.tsx
src/components/HubSpot.tsx
src/components/HubSpotForm.tsx
src/components/index.ts
src/hooks/chiliPiper.ts
src/hooks/hubSpot.ts
src/hooks/index.ts
src/hooks/landingSource.ts
src/pages/2022-gartner-cool-vendors-in-software-engineering.tsx
src/pages/_app.tsx
src/pages/_document.tsx
src/pages/accelerate-dev-onboarding.tsx
src/pages/better-dev-onboarding.tsx
src/pages/code-insights.tsx
src/pages/code-search.tsx
src/pages/contact/[...slug].tsx
src/pages/contact/data.ts
src/pages/contact/request-batch-changes-demo.tsx
src/pages/contact/request-code-change-management-demo.tsx
src/pages/contact/request-code-insights-demo.tsx
src/pages/contact/request-demo.tsx
src/pages/contact/request-info.tsx
src/pages/contact/request-trial.tsx
src/pages/demo.tsx
src/pages/fixing-vulnerabilities.tsx
src/pages/guides/continuous-developer-onboarding.tsx
src/pages/guides/dev-onboarding-how-is-it-unique.tsx
src/pages/guides/fixing-vulnerabilities-less-is-more.tsx
src/pages/guides/how-google-fixes-vulnerabilities.tsx
src/pages/guides/optimizing-developer-onboarding.tsx
src/pages/hackathons.tsx
src/pages/home/index.tsx
src/pages/partner-podcast.tsx
src/pages/resources/abcs-book.tsx
src/pages/resources/universal-code-search-ebook.tsx
src/pages/terms/[...slug].tsx
src/pages/terms/cookie-policy.tsx
src/pages/uninstall.tsx
src/pages/use-cases/code-health.tsx
src/pages/use-cases/code-reuse.tsx
src/pages/use-cases/code-security.tsx
src/pages/use-cases/incident-response.tsx
src/pages/use-cases/index.tsx
src/pages/use-cases/onboarding.tsx
src/pages/webinars/code-insights-turning-your-metrics-into-action.tsx
src/pages/webinars/preparing-for-the-next-log4j.tsx
src/styles/globals.scss
yarn.lock
@sourcegraph/marketing content/terms/archives/privacy/2021-01-15.md
content/terms/archives/subprocessors/2021-12-03.md
content/terms/index.md
content/terms/privacy.md
content/terms/security.md
content/terms/subprocessors.md

@bretthayes bretthayes mentioned this pull request Jun 21, 2022
@bretthayes bretthayes requested a review from zlonko July 7, 2022 15:02
@bretthayes bretthayes marked this pull request as ready for review July 7, 2022 15:02
Copy link
Contributor

@st0nebreaker st0nebreaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so much more simplified 🙌🏻 ! Nice work, Brett. Thanks.

  1. I see the correct forms loading per page.
  2. Contact pages are loading great.
  3. Form data q- I see first_source_url hidden field data on HS, but not anonymous_user_id or form_submission_source. Are they hidden somewhere on this page?

image

4. Verified with a UTM link, no dupe forms, praise be.
  1. For all the Webinar GatedResourceLayout forms, one small quirk I notice: After submitting the form & going back in history, the form is absent & no submission messages are present. Before, the HS form reloads here.

Screen Shot 2022-07-07 at 3 15 53 PM

src/components/HubSpotForm.tsx Show resolved Hide resolved
@bretthayes bretthayes removed the request for review from zlonko July 8, 2022 16:02
@bretthayes bretthayes requested a review from st0nebreaker July 19, 2022 17:32
st0nebreaker
st0nebreaker previously approved these changes Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Investigate UTM params causing duplicate forms Hubspot master forms
5 participants