Skip to content

Commit

Permalink
Update referrer check
Browse files Browse the repository at this point in the history
Fixes #83

Move Android to the bottom of the list, so that user agents for other listening methods that also contain android aren't set incorrectly
  • Loading branch information
jonathanbossenger committed Aug 21, 2021
1 parent efd400d commit cc94016
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions php/classes/class-ssp-stats-hit.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,17 @@ public function track_hit( $file = '', $episode = 0, $referrer = '' ) {
$referrer = 'overcast';
} else if ( stripos( $user_agent, 'Pocket Casts' ) !== false ) {
$referrer = 'pocketcasts';
} else if ( stripos( $user_agent, 'Android' ) !== false ) {
$referrer = 'android';
} else if ( stripos( $user_agent, 'PodcastAddict' ) !== false ) {
$referrer = 'podcast_addict';
} else if ( stripos( $user_agent, 'Player FM' ) !== false ) {
$referrer = 'playerfm';
} else if ( stripos( $user_agent, 'Google-Play' ) !== false ) {
$referrer = 'google_play';
} else if ( stripos( $user_agent, 'Android' ) !== false ) {
$referrer = 'android';
}

// Get episode ID for database insert
// Get episode ID for database insert
$episode_id = $episode->ID;

// Get remote client IP address
Expand Down

0 comments on commit cc94016

Please sign in to comment.