I'd like my form to return to the same page with a param ?success.
The page slug is dynamic though so will change depending on what form you are on.
/dynamic-url?success
{% set entrySlug = craft.request.lastSegment %}
{{ craft.freeform.form("landingPage", {
id: "form-landing",
useRequiredAttribute: true,
returnUrl: "{{ entrySlug }}?success"
}).render() }}
Obviously if i just use returnUrl: "?success"
it takes me back to the homepage.
The idea of this is so I can trigger facebook events upon form completion, so open to any better approaches.
Thanks