Simple Analytics
Adds the cookie-free Simple Analytics script to your public pages. No tracking ID is needed: data is matched to the domain you added in Simple Analytics.
Opens WPIDE on
Code
add_action( 'wp_footer', function () {
$enabled = false; // Set to true once your domain is added in Simple Analytics.
if ( ! $enabled || current_user_can( 'edit_posts' ) ) {
return;
}
echo "<script async src=\"https://scripts.simpleanalyticscdn.com/latest.js\"></script>\n";
} );
Notes
Add your domain in the Simple Analytics dashboard first. Set $enabled to true to start loading the script.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.