Skip to content

Commit 49b6c6a

Browse files
authored
Merge pull request #284 from plausible/fix_invalid_token_error
Fixed: don't assume API token is valid when getting the tracker configuration.
2 parents 74c726d + b4e15a9 commit 49b6c6a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Client.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,12 @@ public function get_tracker_id() {
184184

185185
if ( ! $id ) {
186186
$tracker_configuration = $this->get_configuration();
187-
$id = $tracker_configuration->getId();
187+
188+
if ( ! $tracker_configuration instanceof Client\Model\TrackerScriptConfigurationTrackerScriptConfiguration ) {
189+
return '';
190+
}
191+
192+
$id = $tracker_configuration->getId();
188193

189194
update_option( 'plausible_analytics_tracker_id', $id );
190195
}

0 commit comments

Comments
 (0)