Welcome to WebmasterWorld Guest from 107.20.54.98

Forum Moderators: DixonJones & mademetop

Message Too Old, No Replies

Is it possible to grab utm source for use in hidden form fields?

     
11:59 am on Sep 16, 2010 (gmt 0)

Preferred Member

10+ Year Member

joined:June 11, 2003
posts: 417
votes: 0


Hi,

I'm using Google Analytics utm_source, utm_medium, and utm_campaign to track some paid links on referring websites through to my site.

Typically a person will land on the site, visit a few pages, and hopefully submit a lead.

When they submit a lead, I'd like to be able to get the utm_source, utm_medium, and utm_campaign values from Google (if present) and send them via hidden form fields.

Is it possible to grab these variables from Google Analytics on the form page?

Thanks
12:34 pm on Sept 16, 2010 (gmt 0)

New User

5+ Year Member

joined:May 3, 2010
posts: 11
votes: 0


Hi TravelSite

It is not possible if you are coding plain HTML.
If your page with the form is created dynamically (e.g. with PHP, it is possible (see this example: [joaocorreia.pt...]

Mike
12:54 pm on Sept 16, 2010 (gmt 0)

Preferred Member

10+ Year Member

joined:June 11, 2003
posts: 417
votes: 0


Hi Mike,

Thanks for the solution, that's great (the site is in PHP).
1:17 pm on Sept 16, 2010 (gmt 0)

New User

5+ Year Member

joined:May 3, 2010
posts: 11
votes: 0


Well it is not my solution, I just stumbled upon it a while ago ;-)