0

how can I pass a parameter in a URL to a link on the page. So we have this link setup for all visitors from Facebook.

http://www.domain.com/event?source=facebook

We need to pass the source to the end of a link on the page which leads to a booking engine and registers as a conversion so that

http://www.bookingengine.com/tickets/1234/?ticket=567&event=8910

becomes

http://www.bookingengine.com/tickets/1234/?ticket=567&event=8910&source=facebook

user2679140
  • 153
  • 2
  • 14
  • If you need client side only, this post may help you: http://stackoverflow.com/questions/979975/how-to-get-the-value-from-the-url-parameter – Paulo Segundo Jan 26 '15 at 17:22
  • So you want users to hit a site with the first url example, then turn a link of the second url example into the 3rd example, that right? – atmd Jan 26 '15 at 17:34
  • Yes that's correct it's slightly more complicated in that I'm using advanced custom fields for Wordrpess so the line I need to add it to is `echo 'BUY TICKETS';` – user2679140 Jan 26 '15 at 19:45

1 Answers1

0

Use <?php echo get_permalink($post_ID)."&source=".$yoursource;?> as your link, or something to that effect.

Gavin Simpson
  • 2,766
  • 3
  • 30
  • 39