Extracting UTM parameters from URLs

anpassung

New Member
Joined
Jan 9, 2020
Messages
6
Office Version
  1. 365
Platform
  1. MacOS
Hello,

I am trying to extract the UTM parameters from my Google Analytics URLs with a formula in Excel. I looked on the forum & online but the solutions are for only 1 parameter & I would like to extract them into different columns. Also, I would like JUST the parameter & not umm_xxx. Is there a way to do this? I can pull out what is after the = but my skills are limited to pull out the second or more parameters.


Thanks for any help,

Adj
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi and welcome to the board!

Try this

Book1
ABC
1
2https://www.test.com/test?hp=header&utm_expid=.rv5U4323Tv-MgchhoEB9Dw.0&utm_referrer=header&utm_expid.rv5U4323Tv-MgchhoEB9Dw.0&utm_referrer
3https://www.test.com/us/test?utm_expid=.nv5U6321fv-MgchhoEB9Dw.0&utm_referrer=https:643/www.google.com/.nv5U6321fv-MgchhoEB9Dw.0&utm_referrerhttps:643/www.google.com/
4https://www.test.com/test?utm_  
sheet
Cell Formulas
RangeFormula
B2:C4B2=TRIM(MID(SUBSTITUTE($A2,"=",REPT(" ",250)),250*COLUMNS($B$1:B1),250))
 
Upvote 0
hi there, thanks but it isn't exactly right.
In the test above - I would be extracting
1st url: ".rv5U4323Tv-MgchhoEB9Dw.0" & " " (blank :))
2nd: ".nv5U6321fv-MgchhoEB9Dw.0" & "https:643/www.google.com/"
3rd " " (blank again ;))

Is there a way or just a pipe dream?
 
Upvote 0
You can put the expected result of each of the examples.
If you have more scenarios it is better to put them here.
 
Upvote 0
What are the patterns?
In the first example you get the data after the second sign "="
In the second example you get the data after the first sign "="

Could it be that the first parameter is after the characters "=."?

How many parameters can exist?
 
Upvote 0
Yes, there are a few different utm parameters for URLs that are used in marketing — utm_referrer= or utm_source=

so I need to put the parameters in their own columns
 
Upvote 0
How about in cell B2, Copy to the right and down

Book1
ABCD
2https://www.test.com/test?hp=header&utm_expid=.rv5U4323Tv-MgchhoEB9Dw.0&utm_referrer=.rv5U4323Tv-MgchhoEB9Dw.0  
3https://www.test.com/us/test?utm_expid=.nv5U6321fv-MgchhoEB9Dw.0&utm_referrer=https:643/www.google.com/.nv5U6321fv-MgchhoEB9Dw.0https:643/www.google.com/ 
sheet
Cell Formulas
RangeFormula
B2:D3B2=TRIM(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A2,"&",""),"utm_expid=",REPT(" ",250)),"utm_referrer=",REPT(" ",250)),COLUMNS($B1:C1)*250-249,250))
 
Upvote 0
Hi again,

That works really well for these urls - thanks so much. I really need to develop my skills as this has a couple functions I need to learn to use.

Have a great weekend!
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,307
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top