How we can update the internal links of the page if some visits from specific URL.
For Example.
Some Users comes from Facebook and URL is
https://www.example.com/?utm_source=facebook&utm_medium=cpc&utm_campaign=mobile
and I want to update all my particular links to update based on URL, In case of facebook
Original URL
https://www.example.com/cat/i?pid=ABCD&affid=aff1&affExtParam1=para1&affExtParam2=para2
Updated URL after User visit from facebook link
https://www.example.com/cat/i?pid=ABCD&affid=aff1&affExtParam1=facebook&affExtParam2=mobile
Even If It can edit one parameter in URL that will be helpful.
Note: In param1 and param2 can be any text in exiting page.