Button Tracking (Onclick)
Hi,
I’m trying to set up event tracking in Analytics for button clicks.
In the OnClick field I’ve entered the following; ga(“send”, “event”, “Button”, “Click”, “vmscompare”, “1”);
No matter what I try I can’t get the event to record in Analytics (Realtime or otherwise)
The page URL is https://eleymet.com/digital-height-gauge/
The Button Name is ‘How does the VMS Compare’
Analytics is working and other tracking is working perfectly.
Can you advise what I’m doing wrong?
Thanks
This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
5Hi Carlos
Thanks for reaching out.
Perhaps try:
ga('send', 'event', 'Button', 'Click', 'vmscompare', '1');Hi Andrew,
Thanks for replying.
I’m afraid your suggestion hasn’t worked either.
Is there anything else I could try?
You can perhaps try setting up a test button on a page not using Page Builder to see if that’s working.
<button onclick="ga('send', 'event', 'Button', 'Click', 'vmscompare', '1');">Button</button>https://www.w3schools.com/jsref/event_onclick.asp
Hi Andrew,
Thanks for coming back again. I’ve managed to find a workaround using a plugin.
Thanks for your help
Sure, no problem. Glad to hear you’re making progress :)
Replies on this thread are closed.
Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.