PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Dynamically track form location in page layout

  1. I'm testing an opt-in form at different locations of a page (top, sidebar, lightbox, etc.). Ideally I could create just one form (instead of one for each test) and dynamically track the location. Anyone know of a way that can be done?

    Posted 11 years ago on Saturday August 18, 2012 | Permalink
  2. tcs
    Member

    Have you looked at putting a hidden field in the single form then when you embed the form populate the field with the location you are trying ?

    Posted 11 years ago on Sunday August 19, 2012 | Permalink
  3. Yes I've thought about that, but how to populate the field with the location was hanging me up.

    Posted 11 years ago on Monday August 20, 2012 | Permalink
  4. You would have to populate the hidden field manually using this approach, based on where in the page you embed it. I can't think of another way to automatically determine the location of where in the page the form is embedded.

    You could also create one form, and duplicate it three times. No hidden field required. You can just rename the forms to indicate in which location of the page they're being used. Then you will have views, entries and conversion statistics for the individual forms, based on where in the page they were used.

    Posted 11 years ago on Monday August 20, 2012 | Permalink
  5. tcs
    Member

    Ah - I see now. I was thinking of using shortcode like

    [gravityforms id=1 field_values='form_location=Top']

    But you would probably need use the widget to place the form in your sidebar and the gravity forms widget doesn't have any shortcode way to prepopulate a field. Not sure about lightbox either.

    There is probably some jquery magic someone can suggest for you that you could insert into a html field in the form to populate a hidden field. Then you would just change that depending on where the form was located.

    If you can live with copies of the same form the advantage is gravity forms natively tracks view and entry counts and gives you a conversion rate so you can see at a glance how it's going. You are probably aware making a copy of a form is super quick once the first one is sorted out.

    Posted 11 years ago on Monday August 20, 2012 | Permalink
  6. @tcs, your idea of populating the field_values is a good one. You can pre-populate field values like that using the function call too. That would work too.

    Posted 11 years ago on Monday August 20, 2012 | Permalink
  7. tcs
    Member

    Also just noticed the advanced field option for a hidden field lets you set a default value. So if you are happy to set the field manually for every test run you could use the same form all the time with the hidden field containing the form location.

    Posted 11 years ago on Monday August 20, 2012 | Permalink
  8. I'd like to pull an affiliate ID form the affiliate plugin I'm using into the Gravity form on my product page. The Affiliate guy says:

    You can obtain the referrer ID by calling Affiliates_Service::get_referrer_id().

    Uncertain how to go about including this into my Gravity form through a hidden field.
    Any ideas?

    Posted 11 years ago on Wednesday August 22, 2012 | Permalink
  9. @nomadone, please begin a new topic for your issue as it is unrelated. We'll be happy to help you there. Thanks.

    Posted 11 years ago on Wednesday August 22, 2012 | Permalink

This topic has been resolved and has been closed to new replies.