Skip to content

Commit

Permalink
Fixes exception handling and adds proper feed tracking method to client.
Browse files Browse the repository at this point in the history
  • Loading branch information
padams committed Dec 2, 2022
1 parent 3f15db6 commit bae74bb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/OwaClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace OwaSdk;
use GuzzleHttp\Client;
use GuzzleHttp\Psr7;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\ClientException;
Expand Down Expand Up @@ -202,7 +203,7 @@ public function makeRequest( $params ) {

}

catch( \GuzzleHttp\Exception\RequestException | \GuzzleHttp\Exception\ConnectException | \GuzzleHttp\Exception\ClientException $e ) {
catch( RequestException | ConnectException | ClientException $e ) {

$r = $e->getRequest();
$res = null;
Expand Down
12 changes: 12 additions & 0 deletions src/Tracker/TrackerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,18 @@ public function trackPageview($event = '') {
}
return $this->trackEvent($this->pageview_event);
}

public function trackSyndicationFeed( $feed_format = 'rss', $feed_subscription_id = '') {

$event = $this->makeEvent();

$event->setEventType('base.feed_request');
$event->set( 'feed_format', $feed_format );
$event->set( 'feed_subscription_id', $feed_subscription_id );

// track
return $this->trackEvent( $event );
}

public function trackAction($action_name, $action_group = '', $action_label = '', $numeric_value = 0) {

Expand Down

0 comments on commit bae74bb

Please sign in to comment.