pt_save_data( $key_google_token )){ $update_message = '

Access code saved.

'; } } } $url = http_build_query( array( 'next' => $wp_analytify->pa_setting_url(), 'scope' => ANALYTIFY_SCOPE, 'response_type' => 'code', 'redirect_uri' => ANALYTIFY_REDIRECT, 'client_id' => get_option('ANALYTIFY_CLIENTID'), 'access_type' => 'offline', 'approval_prompt' => 'auto' ) ); // Saving settings for back end Analytics for Posts and Pages. if ( isset( $_POST[ 'save_settings_admin' ] ) ) { update_option( 'post_analytics_settings_back' , $_POST[ 'backend' ] ); update_option( 'analytify_posts_stats' , $_POST[ 'posts' ] ); update_option( 'post_analytics_access_back' , $_POST[ 'access_role_back' ] ); update_option( 'post_analytics_disable_back' , $_POST[ 'disable_back' ] ); update_option( 'post_analytics_exclude_posts_back', @$_POST[ 'exclude_posts_back' ]); $update_message = '

Admin changes are saved.

'; } // endif // Saving Profiles if (isset($_POST[ 'save_profile' ])) { $profile_id = $_POST[ 'webprofile' ]; $display_tracking_code = $_POST[ 'display_tracking_code' ]; $tracking_code = $_POST[ 'tracking_code' ]; $web_profile_dashboard = $_POST[ 'webprofile_dashboard' ]; $web_profile_url = $_POST[ $web_profile_dashboard ]; $webPropertyId = $_POST[ $profile_id."-1"]; update_option( 'pt_webprofile', $profile_id ); update_option( 'webPropertyId', $webPropertyId); update_option( 'pt_webprofile_dashboard', $web_profile_dashboard ); update_option( 'pt_webprofile_url', urldecode( urldecode( $web_profile_url ))); update_option( 'analytify_tracking_code', $tracking_code); update_option( 'display_tracking_code', $display_tracking_code); if( isset( $_POST[ 'ga_code' ] ) ) { update_option( 'analytify_code', 1 ); } else{ update_option( 'analytify_code', 0 ); } $update_message = '

Your Google Analytics Profile Saved.

'; } // Clear Authorization and other data if (isset($_POST[ "clear" ])) { delete_option( 'pt_webprofile' ); delete_option( 'pt_webprofile_dashboard' ); delete_option( 'pt_webprofile_url' ); delete_option( 'pa_google_token' ); delete_option( 'pa_welcome_message' ); delete_option( 'post_analytics_token' ); $update_message = '

Authentication Cleared login again.

'; } ?>

pa_settings_tabs($_GET['tab']); else $wp_analytify->pa_settings_tabs( 'authentication' ); if ( isset ( $_GET['tab'] ) ) $tab = $_GET['tab']; else $tab = 'authentication'; // Authentication Tab section if( $tab == 'authentication' ) { ?>


Do you want to re-authenticate ? Click reset button and get your new Access code.

To fully enjoy this plugin, you need to create a Project in Google Console. Read this simple 3 minutes tutorial to get your ClientID, Client Secret and API Key and enter them in below inputs.

name="auth_step" id="user_keys" /> Step 1. Enter Your API Keys
Step 2. Enter Access Code
Auto Populate following fields

Get Your Access Code

Paste here Access Code.

pt_get_analytics_accounts(); if( isset( $profiles ) ) { ?>


>

Insert Google Analytics JS code in header to track the visitors. You can uncheck this option if you have already insert the GA code in your website.

Don't insert the tracking code for above user roles.

Which type of tracking code to use i-e (Analytics.js , ga.js) Google recommends to use Analytics.js now Read More.

items); ?> items as $profile ) { ?>

Select your website profile for wp-admin edit pages and fron-end pages. Select profile which matches your current WordPress website.

items as $profile ) { ?>

Select your website profile for Dashboard Stats. You can select your any Website profile. It will show Analytics for your selected website profile.


checked >

Check it, If you don't want to load Stats by default on all pages. Remember, There is a section under each post/page. You can still view Stats on pages you want.

Show Analytics to above selected user roles only.

Show Analytics under the above post types only. Buy Premium version for Custom Post Types.

Select which Stats panels you want to display under posts/pages. Only 'General Stats' will visible in Free Version. Buy Premium version to see the full statistics.

Enter ID's of posts or pages separated by commas on which you don't want to show Analytics e.g 11,45,66

Features Free Pro
Support No Yes
Dashboard Yes Yes
Live Stats No Yes
ShortCodes No Yes
Extensions No Yes
Analytics under Posts (admin) Yes (limited) Yes
Analytify under Pages (admin) Yes (limited) Yes
Analytify under Custom Post Types (front/admin) No Yes
UPGRADE to PRO