Change whole button or it's link based on UTM

hi, is it possible to change button link based on utm?

basically I am running some advertisements on multiple sources but I want to track from where purchased are being done.

so if I can change purchase link of PayPal (added in blocs button) based on utm then it will be workable.

please help. thanks

So if I follow correctly, your taking about UTM parameters in the URL right? If so, yes you can have JavaScript detect the parameter, then based on criteria you could replace the button, or just update attributes of the button.

@Malachiman that’s awesome that is what i was looking for :grinning:

but how can I achieve this? I have a button with PayPal link, then based on on following UTM (utm_source=google&utm_medium=cpc&utm_campaign=2021) I want to change that Paypal payment link.

So that I know from which source payments are being done. Because as of now I have no clue!!

I will DM you.

2 Likes

Really appreciate that :heart_eyes: Thanks

@Malachiman
Could you please share your UTM - Button Link solution? I want to try something similar like ac.afd. Thanks!

It was just JavaScript getting the parameters from the url and if a certain value then replacing the button href. I didn’t keep the code, but that’s pretty much all it was.

I’m tied up at present, but plenty of code examples / tutorials online.