2

This is on a client site running EE 2.6.1 and Freeform 4.0.12.

I have a Freeform-based contact form with dynamic recipients in place and working based on user's section of 10 different checkboxes. So far so good.

Now the client is asking that the return page URL be dictated by those same checkboxes - so they can track different things in Google Analytics.

What they want isn't just a 1:1 mapping of checkbox to URL - they want some different combinations (if user selects a & b, do this, if they select all checkboxes do that, etc).

I see Freeform Pro has a return field that allows different return URLs based on the field selection, but what I need is to leverage the existing checkboxes, and be able to insert different logic statements before the final return URL is chosen.

Any ideas?

3

The only thing come to my mind is adding input:hidden field to your form named(return)

then use some JavaScript/Jquery code to change this value depend on checkboxes values.

Regard's.

3

I've had to do similar things in the past.

Generally what I do is set the return to template_group/template/%%entry_id%%

Then, within that template, I use the {exp:freeform:entries} tag to pull up the new entry from the the URL.

Within the tag pair, I use conditionals on whatever fields, or something do a custom plugin to handle the logic, and redirect to the right place.

It's an additional redirect from using a dynamic value in the return parameter, but it lets you use the template engine to handle your logic for the redirect.

4
  • That's about what I was about to write. Basically have return="" point to a URL with the newly-created entry_id present (using %%entry_id%%), to then retrieve the submitted data (using {exp:freeform:entries}), followed by using {redirect=""}, whose value will be different based on the submitted data. – Solspace Mar 17 '14 at 3:13
  • Thanks guys - I'll check to see if this will work for them. In the project mix is a SEM company doing the GA - so long as the intermediary redirect is something they can accommodate in their goal/conversion tracking it should be OK. – Michael Boyink Mar 17 '14 at 12:25
  • SEM guys are asking if "campaign tracking parameters (e.g., source, medium, campaign, keyword) will arrive at the destination thank-you page"? – Michael Boyink Mar 19 '14 at 13:40
  • 1
    You might have to make a custom redirect plugin for that. It's not going to carry through using EE's {redirect=""} tag. – Jeremy Gimbel Mar 19 '14 at 14:19
-4

Yeah like above set the return template to do a redirect based on passed value...

1
  • Can you elaborate, perhaps with some example code? We try to encourage more than one-sentence answers on Stack Exchange. – Adrian Macneil Mar 15 '14 at 22:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.