Level 3REGEXPractice, 4 min
REGEXEXTRACT: pull the campaign out of a URL
The task
In B2, pull the
utm_campaign value out of every landing page URL with one formula. Some URLs have no campaign tag; show (none) for those.The data
The starting sheet. Cells outlined in green are where your formulas go.
| A | B | |
|---|---|---|
| 1 | Landing page | Campaign |
| 2 | https://shop.example.com/boots?utm_source=google&utm_medium=cpc&utm_campaign=fall_boots | |
| 3 | https://shop.example.com/?utm_campaign=brand_search&utm_source=google | |
| 4 | https://shop.example.com/sale?utm_source=meta&utm_campaign=bf_preview&utm_content=video | |
| 5 | https://shop.example.com/socks | |
| 6 | https://shop.example.com/boots?utm_campaign=fall_boots&gclid=abc123 | |
| 7 | https://shop.example.com/?utm_source=newsletter&utm_campaign=weekly_42 |