New Video - How to Use Wix Code with Marketing Tools to Create Custom Events

Hi everyone,

We have a new video - Learn how to create custom events using Wix Code and marketing tools. In this video, we’ll use Wix Code and Google Analytics to create a custom tracking event that monitors e-book downloads from our site. You can follow this process if you want to create and track custom events using Facebook Pixel or Google Tag Manager.


Hey Idan

Thank you so much for this tutorial.

Is it possible to get a tutorial on how to send a purchase Event for Google Enhanced E-commerce Tracking or a Facebook Pixel Purchase Event . I’m not talking about something with Wix Stores but just a plain page containing ’ /thank-you ’ in the URL to capture Key metrics like:

  • price

  • name

  • quantity

  • id

I had a Google Tag Manager Trigger fire on my page containing ’ /thank-you ’ in the URL but the trigger never fires when I reach the Thank You Page via the click of a button… But when I reload the Thank You Page only then does the trigger fire and I can see the event in my Facebook Pixel. Please see video below.

I made a custom Online Store using only Wix Code and I have a Cart Page where after a successful payment via Stripe the items from the cart are deleted and moved to the orders database and there are a lot of data hooks firing for different purposes but on the front end the user is redirected to a final Thank You Page where he/she can see the order summary.

This Thank You Page is where I want the Tag Manager Trigger to Fire but never fires, only when I refresh the page then it fires.

On a Wordpress Website (I saw it on WooCommerce) it fires automatically on the Thank You Page, no need to refresh.

Can you help please ?

Also don’t forget about the tutorial please :see_no_evil::hear_no_evil::speak_no_evil:


Hey Shan,

I had to implement something similar for one of the sites I built. I built the store entirely from scratch using Wix Code as well for the client, and we’re sending the custom events over to both Facebook pixel and Google Analytics using the Wix built-in trackEvent functions. We’re using ecommerce instead of enhanced ecommerce for Google Analytics though.

Hey Chris,
Was your implementation successful? Because I followed the tutorial
but I can’t see the events in Google Analytics. My configuration is the following:
I have a button on one of my pages with the id of downloadButton in my Comentarios page which as its name says is linked to a file download. I placed the following code on the page:
$w.onReady(function () {
//TODO: write your page related code here…
// to query data from the visitors browser
import wixWindow from ‘wix-window’;
export function downloadButton_click(event) {
wixWindow.trackEvent(“customEvent”, {
event: “Funnel”,
eventCategory: “e-book-downloads”,
eventAction: “Downloads”,
}) ;
console.log(“Called Button Function”)
When I verify or test this button, no events are captured. Where have I gone wrong?