Sending custom events to Google Analytics

  • 4 December 2017
  • 2 replies
  • 22 views

When I use my own GA script, how do I send custom events?

I can’t use Unbounce’s inbuilt Google Analytics tracking, because it unfathomably does not let me customize our GA script. I have to use the one deployed via our GTM.

The otherwise well-written Academy page for GA implementation falters on the section titled “Customizing Google Analytics Event Tracking”. It tells me to copy/paste a certain script to every page, but that script doesn’t at all look like something that should just be pasted to every page unaltered. Even if it is, it doesn’t let me know how I can alter that script to put in custom values for the event fields sent to GA. That help section needs multiple clarifications.

Alternatively, I tried to add onclick or onsubmit events, but I don’t see anything in the form interface that lets me access the source code or insert such inline modifications.

I must be missing something. Please point me in the right direction. Thanks!


2 replies

If you are using GTM, have you tried using GTM’s built-in event listeners to send custom events?

For one of my landing pages tracking a third-party form submit, I added a GTM container script to my Unbounce page and set up a trigger to listen for the form submit. I then set up a Universal Analytics tag to send the category (form), action (submit), and label ({{page path}}) to my GA account.

I did, that’s my favorite way to track events, but it doesn’t catch form submit events in this case. I’m assuming that’s because I have linked Unbounce to HubSpot and form fields are matched and sent there for storage. The API communication might be breaking the listeners.

Reply