$\begingroup$

I'm working on a custom e-commerce CMS built on ASP.NET MVC 5. I need to send marketing / analytics events server-side to multiple platforms such as:

  • Google Tag Manager Server-Side
  • Facebook Conversion API
  • Potentially other marketing endpoints later

These events are not business-critical, it's acceptable to lose some events. I do not want to block or slow down the user HTTP request when sending those events.

What is the recommended pattern in ASP.NET MVC for sending HTTP calls? Is HostingEnvironment.QueueBackgroundWorkItem considered an acceptable solution for this use case - or Task.Run? Do you have an example ?

Thanks for your help

$\endgroup$