Best answer

How do I extract UTM from a URL?

  • 21 September 2021
  • 3 replies
  • 3802 views

Userlevel 1

Hello there to anyone please I need some help:

I have this URL:
https://www.okcars.com/?utm_source=mybusiness&utm_medium=referral&utm_campaign=okcars_mybusines

I want to extract the 3 UTMs and send them to the next step:

  • utm_source
  • utm_medium
  • utm_campaign

¿What utility, format or webhook should i use to get this 3 UTMs and send them separetly to the next step?

Thank you in advance

icon

Best answer by Eduardo Barga 4 October 2021, 10:22

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 7
Badge +14

Hi @Eduardo Barga 

Best would be to use a Code step, but that’s an advanced approach: https://zapier.com/apps/code/help

 

 

Output

 

Userlevel 1

It worked perfectly :thumbsup:

Thank you so much !!!

 

Userlevel 1

The javascript code worked perfectly, but in the cases the URL comes without UTMs, the value the field returns is “null” or empty

Example of an URL without UTM campaign, source or medium

¿It is posible to replace this empty value for a default text (for example, “organic”?
 

¿using Javasript to select and replace de empty value?

¡¡¡Thank you so much in advance community!!!