Delete a Query

The Delete query function will allow you to delete a query you have previously created.

In order to do so you will need to know the unique QueryID for the query to be deleted.

Updating a query:

 

Code Block Example
//Include the analytics class and the configuration class
$t->runInteraction("Analytics.class.php");
$t->runInteraction("Config.class.php");
 
//Create our query object
$query = new Query(Config::$ANALYTICS_ANALYST);

//QueryID you wish to delete
$queryId = "56de2fr0219b38e071aac27e";
 
//Call the delete query function
$response = $query->delete($queryId);


Explanation:

 

//delete the query, remembering to pass in the queryId for the query to deleted 
$response = $query->delete($queryId);

This function will delete the query you specify in the $queryId variable.

$queryId (string)

This is the Query ID of the query you wish to delete. You can use the List (Read) Saved Queries function to find your query ID, if you're not sure.

Return:

If the delete was successful the response would be boolean TRUE. If you try to delete a query that does not exist, it will return boolean FALSE.

Return
//If delete was successful 
 
1
 
//If delete was unsuccessful