public function doBulkTrack()
    {
        if (empty($this->storedTrackingActions)) {
            throw new Exception(
                "Error:  you must call the function doTrackPageView or doTrackGoal from this class,
                 before calling this method doBulkTrack()"
            );
        }

        $data = array('requests' => $this->storedTrackingActions);

        // token_auth is not required by default, except if bulk_requests_require_authentication=1
        if (!empty($this->token_auth)) {
            $data['token_auth'] = $this->token_auth;
        }

        $postData = json_encode($data);
        $response = $this->sendRequest($this->getBaseUrl(), 'POST', $postData, $force = true);

        $this->storedTrackingActions = array();

        return $response;
    }
public function doBulkTrack()
    {
        if (empty($this->storedTrackingActions)) {
            throw new Exception(
                "Error:  you must call the function doTrackPageView or doTrackGoal from this class,
                 before calling this method doBulkTrack()"
            );
        }

        $data = array('requests' => $this->storedTrackingActions);

        // token_auth is not required by default, except if bulk_requests_require_authentication=1
        if (!empty($this->token_auth)) {
            $data['token_auth'] = $this->token_auth;
        }

        $postData = json_encode($data);
        $response = $this->sendRequest($this->getBaseUrl(), 'POST', $postData, $force = true);

        $this->storedTrackingActions = array();

        return $response;
    }
public function doBulkTrack ( ) { if ( empty ( $ this -> storedTrackingActions ) ) { throw new Exception ( "Error:  you must call the function doTrackPageView or doTrackGoal from this class,
                 before calling this method doBulkTrack()" ) ; } $ data = array ( 'requests' => $ this -> storedTrackingActions ) ; // token_auth is not required by default, except if bulk_requests_require_authentication=1 if ( ! empty ( $ this -> token_auth ) ) { $ data [ 'token_auth' ] = $ this -> token_auth ; } $ postData = json_encode ( $ data ) ; $ response = $ this -> sendRequest ( $ this -> getBaseUrl ( ) , 'POST' , $ postData , $ force = true ) ; $ this -> storedTrackingActions = array ( ) ; return $ response ; }
Sends all stored tracking actions at once. Only has an effect if bulk tracking is enabled.

To enable bulk tracking, call enableBulkTracking().

@throws Exception
@return string Response
Sends all stored tracking actions at once . Only has an effect if bulk tracking is enabled .