Saving UTM / Referral Codes with Event RSVP

Question:
On all the main entry points of my site, including native Event Details Page (from Wix Events), I capture and save in local storage all UTM codes in the URL to understand the nature of site traffic. I can save this during most transactions (like a student application) as I have control of the form.

However, when a visitor comes to an event page, they RSVP and the RSVP page/form is a native Wix Events page that I cannot modify. As a result, I am trying to use the backend onRsvpCrreated() function to save the info. So far my function is saving all standard event info when someone registers for an event – but I am also trying to save the UTM codes captured on the front-end native RSVP form. The issue is the backend does not have access to front end local storage. What method do I need to be using to get these front end locally stored values to the backend onRsvpCreated() function – HTTPS? If so any tips or is there any code examples you may be able to point me to? THANK YOU!

Product:
Editor

What are you trying to achieve:
Passing front end local storage variable values to back-end when OnRsvpCreated() triggers.

What have you already tried:
Have been struggling with what to try - this is a bit over by level.

Additional information:
All provided above.

Have you tried to setup a custom rsvp form using createRsvp()?

It’s possible you can create a hidden input by using a custom form built with Wix Elements. You would need to make sure the hidden input (UTM) is sent in the associated formValues array object.

This would be captured by the onRsvpCreated() backend event handler.

Thomas thank you! I had not thought of this. Since the whole events area is native to the Wix Events app I am unsure of how I would do this – for example connecting the custom RSVP form to the event details form, etc. Any tips on this that may lead me in the right direction - your approach sure would make things easier!

I’d recommend reading the lifecycle of the custom rsvp form which explains the process and the formData object structure to learn how to build the object in the page code.

The basic idea is to create a rsvp registration form like usual with a field for the UTM, then retrieve the event form and build the formData object in your page code.

You can then create the rsvp passing the formData object which would contain the user entered inputs from your custom form built with Wix Elements and the retrieved UTM from the page code.

Let me know how this approach works and if you run into any issues we can work from there!