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?
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?
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 ?
Yes I've thought about that, but how to populate the field with the location was hanging me up.
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.
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.
@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.
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.
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?
@nomadone, please begin a new topic for your issue as it is unrelated. We'll be happy to help you there. Thanks.