Extract UTM parameters in Google Sheets

1.3k Views Asked by At

I need to extract UTM parameters in Google Sheets and I have, I believe, a simple question.

I would like to extract the value associated to the utm_campaign in column A to column B:

Example

If possible, I would like to keep the opportunity to do an Arrayformula for all the lines in column A and avoid using a script to do so.

2

There are 2 best solutions below

0
On BEST ANSWER

try:

=ARRAYFORMULA(IFNA(REGEXEXTRACT(A2:A, "utm_campaign"":""(\d+)")))

0

0
On

Okay, so I found an answer by myself!
Using the formula below works in that case:

=arrayformula(if(A2:A="","",REGEXEXTRACT(A2:A, "utm_campaign"":""([^""]+)""")))