Mobile app version of vmapp.org
Login or Join
Sarah324

: Does the new Analytics.js have a queue for posting events? ga.js has a queue for posting events asynchronously (see below). Does the new analytics.js have something similar? It looks like there

@Sarah324

Posted in: #AnalyticsEvents #GoogleAnalytics #UniversalAnalytics

ga.js has a queue for posting events asynchronously (see below).
Does the new analytics.js have something similar? It looks like there simply is no need for a queue (presumably the new analytics functions just post to a queue automatically.

_gaq.push(['_trackEvent', 'SubscriptionPlanBtn', 'Click','Success']);
alert ('suucess');


The Google documentation shows _gaq.push (...) replaced by ga(...) (see screenshot below) so I assume that ga() is just "already" asynchronous (or submitting to a queue). But I wanted to confirm this

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sarah324

1 Comments

Sorted by latest first Latest Oldest Best

 

@LarsenBagley505

The GA function is in fact an async wrapper function. It provides a single entry point to the analytics.js code to do everything. The first value is a method, the second is a value, and subsequent ones are parameters.

It is not so much a queue per-sey as each trigger is done straight away but done in an async manner so they can get done in parallel and not block page functionality or loading which overall improves the end user experience.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme