Freshpaint
Search…
⌃K
Links

Transformations

Modify your data before it's sent to destinations

Types of Transformations

Freshpaint supports two uses for transformations

Standard Mapping

Standard mappings are used to re-format the data you send to Freshpaint into the structure that a destination accepts and assigns special meaning to. For example, you can use transformations to rename your add_to_cart event that you're sending to Freshpaint into Facebook or Pinterest's AddToCart event.

Modify Data

You can use transformations to modify the data Freshpaint sends to destinations in order to match historical data or remove sensitive information before they are sent to a destination.

Supported Operations

Rename Event
Rename Property
Change Property Type
Uppercase/Lowercase Property
Delete Property
Send Built-in Property
Send Constant Property
Use this operation to rename the event. For example, if you have an event named order_complete, but you want this to be named OrderCompleted in a destination, you can use this operation.
You can only rename an event once. If you try to add two "Rename Event" operations to a given event + destination combination, you will receive an error.
Use this operation to rename a property. This is often used to fix typos without involving developers, or for fixing data to match historical data.

Example use cases:

Rename a property with a typo like referer to referrer
Rename the property cart_total to revenue
Use this operation to convert between text, number, and true/false values of a property.
If a value cannot be converted to the desired type, it is left untouched.

Convert To Number

When converting a property into a number, we leave everything that is not text untouched. For text, we attempt to parse it as a decimal value, if it has characters that are non-numeric, it fails.
Initial Value
Initial Type
Result Value
Result Type
"-1"
Text
-1
Number
"24.6"
Text
24.6
Number
"$812.37"
Text
"$812.37"
Text
1
Number
1
Number
null
Null
null
Null
"button"
Text
"button"
Text
"$fourty-five"
Text
"$fourty-five"
Text

Convert To Text

When converting a property's value to text, we leave null and text values as-is, but convert objects, arrays, numbers and true/false values. For objects and arrays, we json-encode them without modifying the sub-element's types. For numbers and true/false values, we simply convert them to text as you'd expect.
Initial Value
Initial Type
Result Value
Result Type
true
True/False
"true"
Text
1
Number
"1"
Text
null
Null
null
Null
"button"
Text
"button"
Text
{x: 'yes', y: 23}
Object
'{"x": "yes", "y": 23}'
Text (json-encoded)
[1, 2, 3, "no", false]
Array
"[1, 2, 3, 'no', false]"
Text (json-encode)

Convert To True/False

When converting a property's value to True/False, all values besides the text values t, f, true and false (case insensitive) are let as-is.
Note: the numerical values of 0 and 1 are not converted to false or true
Initial Value
Initial Type
Result Value
Result Type
't'
Text
true
True/False
'f'
Text
false
True/False
'x'
Text
'x'
Text
'TrUe'
Text
true
True/False
'fAlse'
Text
false
True/False
'truthful'
Text
'truthful'
Text
true
True/False
true
True/False
false
True/False
false
True/False
0
Number
0
Number
42
Number
42
Number
Use these operations to convert the value of a property to upper or lower case. Useful for normalizing email addresses, or converting a currency property from usd to USD to match historical data.
Use this operation to delete an event property. This is often useful if you want to remove sensitive data from flowing into a third party destination.
Use this operation to send the built-in properties to destinations that Freshpaint automatically captures for each event.
The following built-in properties are currently supported:
Builtin Property Name
Remarks
Example Value
Time
Unix timestamp when the event was captured
1660750813.235
Device ID
User ID
Identifier for the user. Can be a UUID if the user is anonymous, or the user email if logged in.
OS
Operating System
Mac OS X
Browser
Chrome
Browser Version
104
Current URL
Full url of the page on which the event was captured.
https://yourwebsite.com/pages/target-page.html?param=value
Host
Domain of the page on which the event was captured.
yourwebsite.com
Initial Referrer
Initial Referring Domain
IP
The user's IP Address
Pathname
/pages/target-page.html
Referrer
Referring Domain
Screen Height
Screen height in pixels
1080
Screen Width
Screen width in pixels
1920
UTM Source
UTM Medium
UTM Campaign
UTM Content
UTM Term
Pageview ID
Session ID
Target Text
Text of the element which was clicked on
button text
Href
The href of a link which was clicked on
yourhref.com
You can also see the built-in properties that captures in liveview.
View Built-in properties for each event in Live View
Use this operation to send some constant value as a property. You can use one of the following values:
  • Number, which support numeric values (42, 42.1, 0.123)
  • True/False, which supports only True or False as literal booleans
  • Text, which can be any text

Transformations Dashboard

From the transformation dashboard, you can view and edit your existing transformations, as well as launch the wizard to guide you through creating a new transformation.
Transformations are grouped into sets based on their Transformation Type, Freshpaint Event and Destination.

Creating a new transformation

You can launch the wizard to create a new transformation by clicking the button in the top right.

Add a new operation to a transformation

  1. 1.
    Expand the transformation set you want to modify by clicking on it. If you just created a new transformation via the wizard, it will already be opened.
Expanding a transformation set
2. Click the + button and choose the operation you want to apply. See above for operation descriptions.

Deleting or modifying an operation

  1. 1.
    Expand the transformation set that contains the operation you want to modify by clicking on it. If you just created a new transformation via the wizard, it will already be opened.
  2. 2.
    Click on the operation you want to delete or modify. It will highlight and show a pencil icon as you hover over it.
  3. 3.
    From here you can either change the attributes and click "Save" or delete the operation by clicking "delete."

Deleting an entire transformation set

You can delete an entire set of transformations by clicking on the trash icon on the right side of any transformation set.