1

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

enter image description here

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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