Apply data transformations for data feeds
You can transform your data feed data using any of the following methods:
Each method has advantages and disadvantages. The following sections compare the tradeoffs both generally and for specific transformations.
Compare data transformation methods generally
The following table compares the advantages and disadvantages of each method in general.
- Applied at report time, before your data feed is delivered.
- The same logic applies consistently in both Analysis Workspace and your data feed output.
- Doesn’t consume one of your account’s limited derived fields.
- There’s no limit on the number of component settings you can use.
- Adds processing overhead, which can affect data feed delivery performance
- Only available for the specific set of settings each component supports. Not as flexible as building custom logic with a derived field.
- Applied at report time, before your data feed is delivered.
- The same logic applies consistently in both Analysis Workspace and your data feed output.
- Supports more flexible, custom logic than any single component setting, such as chained conditional rules.
- Some transformations, particularly those that depend on a Scope setting or that parse a URL, are difficult to replicate in SQL.
- Adds processing overhead, which can affect data feed delivery performance
- Adds processing overhead, which can affect data feed delivery performance.
- Uses one of your account’s limited derived fields. If a component setting can do the same transformation, use that instead.
- Not limited by the function and operator limits that apply to derived fields.
- Has no effect on data feed delivery performance.
- Applied after your data feed is already delivered.
- Logic doesn’t apply in Analysis Workspace, so you need to duplicate it there separately.
- Some transformations are difficult or impractical to replicate, particularly those that depend on a Scope setting, that parse a URL, or that deduplicate or persist a value across a scope.
Compare data transformation methods by transformation type
The following table lists specific data transformations, showing which method (or methods) can perform each one, how difficult it would be to replicate in SQL, and which method is recommended.
Component setting
Recommended because it doesn’t consume one of your limited derived fields.
Easy for strings
Moderate to difficult for metrics (requires a CASE statement combined with a COUNT)
Component setting
Recommended for ease of use and because it doesn’t consume one of your limited derived fields.
Derived field
Recommended because the same logic applies consistently in both Analysis Workspace and your data feed output.
Derived field
Recommended because the same logic applies consistently in both Analysis Workspace and your data feed output.
Derived fields
Recommended because the same logic applies consistently in both Analysis Workspace and your data feed output.
Component setting
Recommended because:
- The same logic applies consistently in both Analysis Workspace and your data feed output (not possible with SQL)
- It doesn’t consume one of your limited derived fields.
Component setting
Recommended because it doesn’t consume one of your limited derived fields.
Derived field
Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.
Depends on a Scope setting (uses session as the scope, and it is not configurable). See How Scope settings affect data feeds.
Derived field
Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.
Component setting
Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.
The Treat “No value” as a value option applies to data feeds, while the Don’t show “No value” by default and Show “No value” by default options do not apply to data feeds.
Derived field
Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.
Easy / Moderate
A lookup table must already exist.
Component setting
Recommended because:
- The same logic applies consistently in both Analysis Workspace and your data feed output (not possible with SQL)
- It doesn’t consume one of your limited derived fields.
Derived field
Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.
Component setting
Recommended because it doesn’t consume one of your limited derived fields.
Difficult
Requires custom string parsing to extract the same components.
Derived field
Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.
Component setting
Recommended for ease of use and because it doesn’t consume one of your limited derived fields.
Component setting
All three approaches produce the same result, but prefer the component setting because:
- The same logic applies consistently in both Analysis Workspace and your data feed output (not possible with SQL)
- It doesn’t consume one of your limited derived fields.
Derived field
Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.
Derived field
Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.
Component setting
Recommended because:
- The same logic applies consistently in both Analysis Workspace and your data feed output (not possible with SQL)
- It doesn’t consume one of your limited derived fields.
Derived field
Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.
How Scope settings affect data feeds scope-settings
Date Math, Deduplicate, Next or Previous, and Summarize each depend on a Scope setting of Event, Session, or Person (the available options vary by function). Depth has no configurable Scope field, but is inherently tied to the session, similar to the standard Event Depth dimension. Any field with a scope writes the same value to every row within that scope, and that value depends on the data within the lookback date range.
Because the lookback date range slides forward with each data feed delivery, the same field can return a different value on a later delivery, even for events that already occurred.
Risk increases with scope size: Person scope carries more risk than Session scope, because a person’s history has no natural time boundary within a feed run.
Derived field function templates
Derived field function templates let you quickly create a derived field for a specific use case, such as building marketing channels, detecting bots, or extracting a UTM parameter from a URL. Because a template is built from a chain of pre-built rules, using one is almost always preferable to reproducing the same logic in SQL from scratch, as with the Marketing Channel Template.
If a template includes a function that depends on a Scope setting, the template inherits that function’s scope caution. See How Scope settings affect data feeds.