Google Analytics considers a file download a link to one of their supported file types. But my single page app generates files on the fly and then generates a hyperlink with base64 data and prompts the user to download it. I want to capture that event as a Conversion as far as analytics is concerned. After my file download code, I'm sending

gtag('event', 'file_download', {'send-to':'downloads'});

I see the event being posted in the console and google reports a 204 No Content status back, so everything is working at the network level. But I am not seeing any events listed under Events > events or Engagement > events or even Dashboard > top events. What could be going wrong?

  • I'd be careful using 'send-to'. GA4 does not allow you to define dimensions with a '-' in them, and it is very close to 'send_to' which is reserved and controls what property receives the event. Otherwise it looks like it should work. Try using the GA4 DebugView to see if it is received. Mar 22, 2021 at 21:59

1 Answer 1


https://developers.google.com/analytics/devguides/collection/gtagjs/events shows how to do it. The general case from there is:

gtag('event', 'aaa', {
  'event_category' : 'bbb',
  'event_label' : 'ccc'

You are not setting the event_category or the event_label. All you are sending is the send-to data which Google Analytics will ignore because it doesn't know how to deal with it. You need to send the event like:

gtag('event', 'file_download', {
  'event_category' : 'send-to',
  'event_label' : 'downloads'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.