Hi I need help with tracking ID My website receives traffic with tracking ID eg example[.]com/?tid=ag1 ; example[.]com?tid=ag2 etc
I have a buy now button there with an external link let’s say “gotothissite[.]com”
I want this external link to automatically modify itself to the tracking ID. So if I get a visit to my website via url example[.]com?tid=google then my external link should automatically modify as gotothissite[.]com/?tid=google
From What I know is that php $_GET[“tid”] can be used to achieve this. Can anyone guide me with it.
P.S. I don’t have any php coding knowledge but I do know HTML and CSS. The website is built on wordpress. [.] is used because of link post limit in the forum and http is removed for the same reason.
I mean, How can I capture tid value when someone visits my site and then place it on the code provided above. Here is an example of website: https://pregnancymiracle.infomay.com/?tid=chorn which whenever visited by a tid then the external link’s tid get the same tid?
I think, with respect, what you need to do is put aside what you actually need to do here, and get yourself a basic familiarity with PHP. You don’t say above whether you’ve any actual programming background, so that will alter whether you’re learning programming and PHP, or just translating knowledge of a language you are familiar with into PHP. I’m also not putting down HTML and CSS or suggesting they’re somehow much “easier”, but they’re quite different to coding.
Sit down and work through some examples on how to do basic stuff with PHP and you’ll see that what you need to do is relatively simple.
Might you just send me the code which I just copy and paste and see if it works without having to edit even a single char. Just so I know if it works, if it does then I would figure out myself which things to replace when I write it on my website.
On that, it’d be great if you could post your code in the forum rather than linking to screen shot images, it makes it more difficult to help. Not so much in the short examples we’re doing here, of course. As @m_hutley posts code in the forum, why can’t you copy/paste that into your code?
But generally, the idea of a support forum is to send you in the right direction, rather than just write the code for you.
That still isn’t right, there are far too many quotes and you’ve got a html-encoded part too. Compare it to the post on here.
I know nothing about Wordpress, so don’t know whether that answered the questions - I presume that makes it a ‘yes’ to both of them. Just seemed a bit strange that looking in your latest screen shot of the output, it doesn’t seem to have processed the PHP code at all.
Try it this way instead, in case your server doesn’t support PHP short-tags (not sure if that’s possible, but might be worth a try):