Skip to content
This repository was archived by the owner on Feb 19, 2026. It is now read-only.

Add createOnlyProperties#25

Open
alankalb wants to merge 1 commit intoPostHog:mainfrom
alankalb:main
Open

Add createOnlyProperties#25
alankalb wants to merge 1 commit intoPostHog:mainfrom
alankalb:main

Conversation

@alankalb
Copy link

This PR adds the ability for users to define fields that should only be passed to Hubspot when creating a new contact. This will prevent overriding of the specified fields if the identified person in Posthog already exists in Hubspot.

Within Hubspot it is possible to restrict field editing access to teams and users but those restrictions do not apply to API keys: https://knowledge.hubspot.com/account/restrict-edit-access-for-properties

Like the additionalPropertyMappings config property, users can pass the fields to createOnlyProperties they would like to restrict from updating using a comma separated list of Hubspot property names. If the plugin is unable to create a new contact when the contact already exists, it loops through the all of the createOnlyProperties and deletes them from hubspotFilteredProps before making the PATCH request to the existing contact.

An example problem this solves:
Hubspot contacts can either be created manually by sales reps or automatically via the Posthog integration to a webapp. When created manually, the sales reps add the value of [sales rep name] to a source property in Hubspot. If created automatically via the webapp, the value of the source property is set to [web app name]. If a contact that was manually added to Hubspot signs up for the webapp, the source field of the contact will no longer be updated to [web app name].

@alankalb
Copy link
Author

@yakkomajuri Are you able to take a look at this PR?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant