Name of affected component: Web Tracking (analytics.js)
Issue summary:
In certain conditions (which I have not fully isolated yet) the cxApi library
loads, but only has two methods/attributes - setCookiePath and chooseVariation
- available.
This runs counter to what I understood from the documentation that all the
functions (getChosenVariation, setChosenVariation, etc) would be available on
cxApi provided the library has loaded.
URL of the page exhibiting the issue: https://vessel.com
Steps to reproduce issue:
Unfortunately, I have not determined repro steps yet. We identified this issue
from error tracking software deployed on our site. Certain users experienced an
uncaught error when our code attempted to call cxApi.getChosenVariation().
Another line of JS just above this one called cxApi.chooseVariation() with no
failure, and the cxApi global was available and defined on the page.
Expected output:
cxApi should in theory always have all its methods present once it is loaded.
Actual results:
Sometimes cxApi is defined, but only has two methods (chooseVariation and
setCookiePath).
Notes:
After this happened on our site, I added a null check for the
getChosenVariation function, and then sent a debugging beacon with the keys of
the cxApi object to our backend in the event that that getChosenVariation
function was undefined. From this, I determined that sometimes the object only
has the two keys "chooseVariation" and "setCookiePath".
Watered down example GIST of the code which errored:
https://gist.github.com/alexhancock/ae8f9fd98923d9a27d03
A screenshot of a JS tracktrace we got in a bug report from one of our users:
https://pbs.twimg.com/media/CG6gUbKUYAEBYVI.png
Original issue reported on code.google.com by alexhanc...@gmail.com on 10 Jun 2015 at 10:16
Original issue reported on code.google.com by
alexhanc...@gmail.com
on 10 Jun 2015 at 10:16