-3

How to get parameters section in a URL after ? and put it in a button who's href + params leads to another landing page . Means I need to pass UTM params to another page.So, I am thinking to apply JS in the button who will add those UTM params to it's original href.

home page: https://www.fylehq.com/?utm_campaign=Capterra%20-%20November%202018&utm_source=capterra

this is the page after clicking button: https://www.fylehq.com/start?hsCtaTracking=f52ee3b4-0d97-42fe-bbee-c5a082ae2985%7Cc39c4eda-024b-40bd-8330-a06ac2ab146f

and this is what I need: https://www.fylehq.com/start?utm_campaign=Capterra%20-%20November%202018&utm_source=capterra

1 Answers1

0

This is a duplicate of this post: How can I add "href" attribute to a link dynamically using JavaScript?

Read the post, create the href you want and replace it like in the post, or you can get the url and simply add the UTM parameters to it like this

a.href = a.href + "add here"
Art3mix
  • 1,276
  • 7
  • 18