Every lead logged with its source, straight into a Google Sheet
A real estate business on Wix had three lead forms and a phone number people copied instead of clicking. None of it was tracked as a conversion, and nobody could tell which campaign a lead came from.
What was broken
Leads arrived by email with no record of where they came from. Wix forms did not expose a reliable submit event, and the phone number was plain text, so the most common contact action was invisible.
What I changed
Custom JavaScript pushes a separate data layer event for each form: generate_lead (home), talk_to_us and contact_us, all marked as primary conversions in GA4.
A phone_copy event fires when someone copies the phone number, and email_click tracks clicks on the email address. Both are secondary conversions.
UTM parameters are saved to localStorage on the first visit, so the original source survives page changes until the form is sent.
A GTM tag sends each lead with its UTMs to a Google Sheet through Apps Script, giving the client a lead log with attribution.
How it was verified
All events were checked in GA4 DebugView and GTM preview on desktop and mobile, and test leads were confirmed in the Google Sheet with the correct source and medium.