How to add custom tracking pixel to button?

The button has a link but I want it tracked every time it is tracked. I did check the trackEvent() but didn’t understand how to implement it. Can someone please help me?

export function button8_click(event) {
 //Add your code for this event here: 
}

so my on click tracking pixel is i.jvzoo. com/0/3595/99

Most events doesn’t have any link option, so I’m confused.

Hello,

You can embed you custom third-party tracking code using Tracking Tools&Analytics.

About Tracking Tools & Analytics

If you want to use Corvid Tutorial: Sending Tracking and Analytics Events , please note that c urrently, you can send events through code to Google Analytics and Facebook Pixel.

Hi,

I wanted to add the tracking link on a particular button, isn’t that possible?

Did you read the tutorial that was linked?

It does it through a button…
https://support.wix.com/en/article/corvid-tutorial-sending-tracking-and-analytics-events#tracking-code-1

export function downloadButton_click(event) {
  wixWindow.trackEvent("CustomEvent", {
    "event": "Document Download",
    "eventCategory": "Downloads",
    "eventAction": "Download",
    "eventLabel": $w('#dataset1').getCurrentItem().title
  } );
}

See here for more info.

https://support.wix.com/en/article/tracking-click-events-with-google-tag-manager

Master GOS,

I had a download link (excel) and tracking working fine.
Changed to a download button connected via a dataset, as per the tutorial you reference, and now it fails:

If I enable the onClick event handler of the download button (which points to the wixWindow.trackEvent), then the Google tracking fires fine, but the document (excel) is not offered for download.

If I disable the onClick event handler of the download button, then the document downloads fine, but the Google event does not fire.

So, I can have the document download, or the tracking, but not both.

The tutorial suggests that you can have the button connected via the dataset, AND you can add an onClick event handler for the tracking - and both should work.

That clearly fails.
What am I missing?

Master GOS - any comments on that tutorial?

Hey brainstorrrm, im facing the same issue, did you find a solution on how to add custom events and a the same time keep the button click behavior?

@ghobashy
The tutorial is crap - epic Wix fail.
I’ve run into bad tutorials before, and always got them to work in the end, after tinkering and avoiding the errors or differences in configurations in the tutorials.

Not this one.
Wasted a ton of time on this and finally gave up.
If you or anybody else have some insight, please share it.