Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

To create reports out of your logged data, you must first create a query.

...

Code Block
languagephp
themeRDark
firstline1
titleCode Block Example
linenumberstrue
//Include the analytics and configuration classes
$t->runInteraction("Analytics.class.php");
$t->runInteraction("Config.class.php");

//Create our query object
$query = new Query(Config::$ANALYTICS_ANALYST);
 
$name = "List all #event#";
$type = "find";
$params = array(
    "name" => "#event#",
    "date" => array (
        "\$gte"=> "#gte#",
        "\$lte"=> "#lte#" 
    ),
    "tags.group" => "#group#"
);
//save query, returns object with unique Query ID
$response = $query->save($name, $type, $params); 


Explanation:

The first two "runInteraction" lines will simply "include" the class files you already uploaded. Make sure your have used the correct interaction names. You will need to put both of these lines on any page, or interaction, that you will be calling the class.

  

//create object
$analytics = new Event(Config::$ANALYTICS_COLLECTORANALYST);

This line will simply create the $analytics object, using the details from the the Config.class.php file. You don't need to modify this line.


//save query, returns object with unique Query ID
$response = $query->save($name, $type, $params);

...