Can Adwords data be sent with PHP email forms?

Discussion in 'PHP' started by muchacho79, Mar 6, 2009.

  1. #1
    I have a website that currently uses a standard PHP form to email me their name and contact details. Nothing out of the norm there.

    However what I'm wanting if possible is for the email I receive to include Adwords information such as the keyword they typed and which ad they clicked on.

    You can use parameters in Adwords which add themselves to the destination URL. For example: domain.com?kw=widgets

    (widgets is what the visitor typed in)

    With the URL information do you think it would be possible to grab these variables and add them to the form data, through PHP?

    Cheers in advance.
     
    muchacho79, Mar 6, 2009 IP
  2. carolynheath

    carolynheath Peon

    Messages:
    680
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Sure, just use a hidden form value. echo "<input type=\"hidden\" name=\"keyword\" value=\"$_GET["kw"]\">";, or something to that effect :).
     
    carolynheath, Mar 6, 2009 IP
  3. muchacho79

    muchacho79 Active Member

    Messages:
    672
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Thanks, but 'something to that effect' won't really work with me as I don't know any PHP at all! lol. I'd need the code to be absolutely spot on as I won't know what to change if it doesn't work.

    Would the above code go on the webpage (where the form is) or inside the process.php (that sends me the form data).
     
    muchacho79, Mar 6, 2009 IP
  4. carolynheath

    carolynheath Peon

    Messages:
    680
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #4
    "<input type=\"hidden\" name=\"keyword\" value=\"".$_GET["kw"]."\" />" <-- That string will output the hidden value you need, so it would go wherever the rest of your form is, and your emailing script would handle it on the other end. If you don't know any PHP and can't figure it out, I'd be happy to edit your script to add this feature for $15. :)
     
    carolynheath, Mar 6, 2009 IP