URL parameters to event properties

URL parameters to event properties

Converts URL query parameters to event properties

Configuration

OptionDescription
URL query parameters to convert
Type: string
Required: False

Comma separated list of URL query parameters to capture. Leaving this blank will capture nothing.

Custom property names
Type: dictionary
Required: False

Capture URL parameters under custom property names. The key is the URL parameter and the value is the property name to store it as, e.g. key 'fid' with value 'follower_id' stores ?fid=123 as the property follower_id. Parameters listed here are captured even if they are not in 'URL query parameters to convert', and the prefix and suffix are not applied to them.

Prefix
Type: string
Required: False

Add a prefix to the property name e.g. set it to 'prefix_' to get followerId -> prefix_followerId. Not applied to parameters with a custom property name.

Suffix
Type: string
Required: False

Add a suffix to the property name e.g. set it to '_suffix' to get followerId -> followerId_suffix. Not applied to parameters with a custom property name.

Ignore the case of URL parameters
Type: choice
Required: False

Ignores the case of parameters e.g. when set to true than followerId would match FollowerId, followerID, FoLlOwErId and similar

Add to user properties
Type: choice
Required: False

Additionally adds the property to the user properties

Add to user initial properties
Type: choice
Required: False

Additionally adds the property to the user initial properties. This will add a prefix of 'initial_' before the already fully composed property e.g. initial_prefix_followerId_suffix

Always JSON stringify the property data
Type: choice
Required: False

If set, always store the resulting data as a JSON array. (Otherwise, single parameters get stored as-is, and multi-value parameters get stored as a JSON array.)

Using our REST API you can create this transformation like so:

Terminal
# Create a new destination
curl --location 'https://us.i.posthog.com/api/environments/:project_id/hog_functions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <POSTHOG_PERSONAL_API_KEY>' \
--data '{
"type": "transformation",
"name": "URL parameters to event properties",
"inputs": {},
"enabled": true,
"template_id": "plugin-posthog-app-url-parameters-to-event-properties"
}'

Community questions

Questions about this page? or post a community question.