Table transformations

How to extract UTM tags from a link into separate columns

2026-06-20
Task

The url column contains a link with utm_source, utm_medium, and utm_campaign. The export needs a separate column for each tag.

Short Answer

You can extract the value by removing parts of the string step by step. For many links, the regex option is shorter.

How to do it in Eofferix with substring search and removal

  1. Create the final utm_source column from url.
  2. Add a rule: Contains substring utm_source=Remove before. After it, the string starts with the needed parameter.
  3. Add a rule: Contains substring utm_source=Remove substring utm_source=.
  4. To remove following parameters, add rule pairs for & and #: Remove after, then Remove substring.
    Extracting utm_source by removing string parts
    Without regex, the rules cut everything before utm_source, remove the parameter name, and cut the tail after the value.
  5. Repeat the same pattern for utm_medium and utm_campaign, replacing the parameter name.

How to do it in Eofferix with regular expressions

  1. For utm_source, add: Regular expression (?<=utm_source=)[^&#]+, action Remove everything except.
  2. (?<=utm_source=) means “start right after utm_source=”. [^&#]+ means “take one or more characters until & or # appears”.
    Regex rule for extracting utm_source
    The regex keeps only the utm_source parameter value.
  3. Use (?<=utm_medium=)[^&#]+ for utm_medium and (?<=utm_campaign=)[^&#]+ for utm_campaign.

Before / After

Before

source data
row_idurl
1https://shop.example.com/product?utm_source=google&utm_medium=cpc&utm_campaign=spring_sale

After

result
row_idutm_sourceutm_mediumutm_campaign
1googlecpcspring_sale

Process data faster with Eofferix

Create a free account to automate catalogs and price lists around your own rules.

Sign up