EXAMPLES - ZIM Wonder collects data from code you put in your script - assuming you have included the latest ZIM:
// wonderID is e-mailed to you when you sign up // client is your client's name that you provide // app is the app for which you are recording data // you can also pass an optional note var wonder = new Wonder("wonderID", "client", "app"); // COUNT EXAMPLE // for this example we count times a button is pressed var button = new Button().center(); // will center and add to stage button.on("click", function(){ // records an entry for this keyword in your stats // along with date, time, session, etc. wonder.count("wow"); });
LOGIN - after running Wonder in your app, login to your Wonder account and you will see data similar to below. You can then copy and paste this into a spreadsheet and split on the commas:
TIME - here is an example that records how much time it takes to drag a circle onto a square:
// TIME EXAMPLE // assuming we have our Wonder object from above // (you only need one Wonder object) // start the timer counting for a keyword called "test" // this will record nothing until you timeEnd() // or you timeStart() again // you can also timePause() and timeUnpause() // see DOCS for more functionality and information wonder.timeStart("test"); // add the circle var circle = new Circle(100, "red").center().drag(); circle.on("pressup", function(){ if (circle.hitTestRect(square)) { // if the shapes are hitting then end the timer // this will send data to your Wonder report wonder.timeEnd("test"); } }); // add the square to a random location on stage var square = new Rectangle(100, 100, "yellow") .pos(rand(stageW-100), rand(stageH-100));
LOGIN - after running Wonder in your app, login to your Wonder account and you will see data similar to below showing it took 33 seconds from the loading of the page to drop the circle on the square:
ORDER - here is an example that shows the order a user presses tabs:
// ORDER EXAMPLE // assuming we have our Wonder object from above // (you only need one Wonder object) // make tabs var tabs = new Tabs(400, 40, ["MOUSE", "CAT", "MONKEY"]) .center(); tabs.selectedIndex = -1; // start with no selection var count = 0; // perhaps get the first four presses tabs.on("change", function(){ // record which tab was pressed // this gets stored under keyword animal wonder.order("animal", tabs.text); count++; // turn the order recording off for "animal" if (count == 4) wonder.orderOff("animal"); });
LOGIN - after running Wonder in your app, login to your Wonder account and you will see data similar to below showing Monkey, Cat, Mouse and Cat again were pressed. Note, with tabs, we can't press the current tab unless we set currentEnabled to true in the Tabs parameters.
FREQUENCY - do not put Wonder calls inside loops, Tickers, intervals, etc. Calls are batched every second and after 30 seconds of continuous batching, Wonder will terminate and add an error line to your report. It can then be used on the next load.
BACKUP - the report is for the current year starting New Years Day with a backup of one prior year.
Service is provided as is and details may change in time - we will e-mail you if they do. If you wish to help support ZIM, you can do so here: DONATE