Skip to content

Commit

Permalink
use add_query_arg to re-add AMP parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
stklcode committed Jul 19, 2021
1 parent 79255c6 commit 613c061
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions inc/class-statify-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,9 @@ public static function track_visit( $is_snippet = false ) {

/*
* Re-add AMP parameter to keep that information (only applicable for JS tracking).
* We can assume "amp" to be the only parameter, as ${canonicalPath} already eliminates other queries.
*/
if ( $is_snippet && isset( $parsed_target['query'] ) && 'amp/' === $parsed_target['query'] ) {
$data['target'] .= '?amp';
add_query_arg( 'amp', '', $data['target'] );
}
}

Expand Down

0 comments on commit 613c061

Please sign in to comment.