Fudge can fire custom JS events to your analytics

Liquid, JS, and logic
•
Logic & Targeting

Fire a GA4 and Meta Pixel event when a shopper clicks a button, plays a video or scrolls, with the page URL attached and cookie consent respected.

Try this prompt

Track when users click "CTA label" on /pages/your-page — fire to both GA4 and Meta Ads.

→ Replace each highlighted slot with details from your store before sending.
Want more control? See the expanded prompt ›

Fire a GA4 event called `start_quiz_clicked` when a user clicks the 'Start the quiz' button on /pages/find-your-match. Also fire to Meta Ads as a `Lead` event. Include the page URL in the event properties.

Pattern
[Element] + [Placement scope] + [Triggers] + [Style direction] — Fudge fills in the rest (brand voice, fonts, photography, shipping, schema) from your store.
You say
Fudge fills in automatically
"Start the quiz" button on specific page
Element and location
Fire to both GA4 and Meta Ads
Destinations
AUTO
GA4 event name (`start_quiz_clicked`)
AUTO
Meta Ads event type (`Lead`)
AUTO
Page URL in event properties
Key takeaways
  • Fires custom events on any click, scroll, or interaction.
  • Hits GA4, Meta Pixel, TikTok Pixel — any platform you're connected to.
  • Event properties (page URL, product, value) are configurable.
  • Testable: check each event in GA4 DebugView and Meta's Test Events before publishing.

What you're trying to do

Marketing platforms get smarter the more events you feed them. Off-the-shelf event tracking covers pageviews and add-to-cart, but the events that matter — quiz starts, video plays, popup signups, scroll-to-section — usually need custom wiring. Fudge writes that code for any element you name.

Things to watch out for

  • Event consistency: Fudge uses GA4 conventions (snake_case names).
  • Privacy: Fudge makes each event respect cookie consent.
  • Platform parity: the same event can fire to several platforms at once.
  • Debug mode: Fudge can turn on GA4 debug mode so you can check events in DebugView.
Want this built for you? Fudge does it in minutes.
Try this in Fudge

How Fudge does it

Fudge duplicates your live theme into a draft, makes the targeted edit (Liquid logic, JS event, conditional rendering) your prompt requires, and tests it on the draft preview. Everything starts in draft — review the diff, verify the behavior, and publish when you're ready. Your live store stays untouched.

Why custom event tracking matters for paid traffic

Default GA4 and Meta Pixel events miss the things you actually care about — quiz starts, video plays, cart abandonment moments, scroll depth. Custom events fill the gap and give the ad platforms the data they need to optimize ad creative.

When this is worth doing

Set up custom events for any high-leverage interaction — quiz starts, video plays, custom CTAs. Especially worth doing before scaling paid traffic, since the event data will inform the spend.

What makes a great implementation

  • Specific events for high-leverage actions — not just clicks.
  • Fired to GA4 + Meta Ads — both platforms need the data.
  • Page URL in event properties — so you can see which page each event came from.
  • Privacy-aware — respects cookie consent; Fudge builds this in.
  • Event names that match Meta’s standard event vocabulary — Lead, AddToCart, Purchase. Lets Meta optimize better.

Common mistakes to avoid

The biggest mistake is over-eventing. Too many custom events make the data noisy and harder to analyze. Pick the 5–10 highest-value actions.

The second mistake is missing the privacy layer. Tracking without consent triggers GDPR/CCPA issues.

Pair this with UTM capture in lead forms and ROAS optimization, three tools for tracking and ad optimization. Fudge writes the tracking code with its store editor; for the manual steps, see how to add custom events in Shopify.

Common questions

Do I need GTM (Google Tag Manager)?
No. Fudge can fire events directly to GA4, or through Google Tag Manager if you already use it.
Can I track scroll depth?
Yes. Fudge can fire an event when a shopper scrolls to 25%, 50%, 75% and 100% of the page.
What about server-side events?
Theme code can't send server-side events. For Meta's Conversions API, use Shopify's Facebook & Instagram app; Fudge gives custom events an event ID so they aren't counted twice.

Try Fudge free

Install the Shopify app and run this exact prompt in under a minute.