0

I am attempting to send an event to Google Universal Analytics:

ga('send', {
    hitType: 'event',
    eventCategory: 'calculator-interaction',
    eventAction: 'click',
    eventLabel: 'calculate-button'
});

but I am getting the following error:

Running command: ga("send", [object Object])
analytics.js:31 Command ignored. Unknown target: undefined

The Google Universal Analytics is being included in the page via Google Tag Manager if that makes a difference?

Finglish
  • 9,692
  • 14
  • 70
  • 114
  • i think there is a related question https://stackoverflow.com/questions/28765806/existing-google-analytics-events-and-google-tag-manager – Sebastian Offers Dec 29 '21 at 17:28

1 Answers1

1

Ga needs a tracker object to send commands. Are you using ga('create', 'UA-XXXXX-Y', 'auto')?

If yes, you might be specifying a named tracker instead. In this case, you will need to target it specifically by calling ga('name_of_the_tracker.send', options)