Google Analytics - Version 1.1

Version Description

  • added anonymize IP's option
  • added uninstall file
Download this release

Release Info

Developer webkinder
Plugin Icon 128x128 Google Analytics
Version 1.1
Comparing to
See all releases

Version 1.1

css/admin-styles.css ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Google Analytics by WebKinder
3
+ * Admin CSS Styles
4
+ */
5
+
6
+ #track-device button.wk-button.not-tracked {
7
+ background-color: #c9ffc9;
8
+ }
9
+
10
+ #wk-google-analytics-settings>div {
11
+ margin-bottom: 15px;
12
+ }
js/admin-functions.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Google Analytics by WebKinder
3
+ * Admin JS Functions
4
+ */
5
+
6
+ var WKGA_AdminFunctions = {
7
+ CookieName: 'wp_wk_ga_untrack_' + document.location.hostname,
8
+ UntrackText: text_content.UntrackText,
9
+ TrackText: text_content.TrackText,
10
+
11
+ init: function( containerID ) {
12
+ this.containerID = containerID;
13
+ this.buttonSelector = containerID + " .wk-button";
14
+ jQuery( containerID ).html('<button class="wk-button button-secondary"></button>');
15
+
16
+ this.renderButton();
17
+
18
+ jQuery( containerID + " .wk-button" ).click( function() {
19
+ this.handleClick();
20
+ }.bind(this) );
21
+
22
+ },
23
+
24
+ renderButton: function( containerID ) {
25
+ var buttonText = Cookies.get( this.CookieName ) ? this.UntrackText : this.TrackText;
26
+ var buttonClass = Cookies.get( this.CookieName ) ? "not-tracked" : "tracked";
27
+ jQuery( this.buttonSelector ).removeClass('tracked not-tracked').addClass(buttonClass).text( buttonText );
28
+ },
29
+
30
+ handleClick: function() {
31
+ if( Cookies.get( this.CookieName ) ) {
32
+ Cookies.remove( this.CookieName );
33
+ } else {
34
+ Cookies.set( this.CookieName , true, { expires: 365 } );
35
+ }
36
+ this.renderButton();
37
+ console.log( document.cookie );
38
+ }
39
+
40
+ }
41
+
42
+ jQuery(document).ready(function(){
43
+
44
+ WKGA_AdminFunctions.init( '#track-device' );
45
+
46
+ });
js/js.cookie.js ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * JavaScript Cookie v2.1.2
3
+ * https://github.com/js-cookie/js-cookie
4
+ *
5
+ * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
6
+ * Released under the MIT license
7
+ */
8
+ ;(function (factory) {
9
+ if (typeof define === 'function' && define.amd) {
10
+ define(factory);
11
+ } else if (typeof exports === 'object') {
12
+ module.exports = factory();
13
+ } else {
14
+ var OldCookies = window.Cookies;
15
+ var api = window.Cookies = factory();
16
+ api.noConflict = function () {
17
+ window.Cookies = OldCookies;
18
+ return api;
19
+ };
20
+ }
21
+ }(function () {
22
+ function extend () {
23
+ var i = 0;
24
+ var result = {};
25
+ for (; i < arguments.length; i++) {
26
+ var attributes = arguments[ i ];
27
+ for (var key in attributes) {
28
+ result[key] = attributes[key];
29
+ }
30
+ }
31
+ return result;
32
+ }
33
+
34
+ function init (converter) {
35
+ function api (key, value, attributes) {
36
+ var result;
37
+ if (typeof document === 'undefined') {
38
+ return;
39
+ }
40
+
41
+ // Write
42
+
43
+ if (arguments.length > 1) {
44
+ attributes = extend({
45
+ path: '/'
46
+ }, api.defaults, attributes);
47
+
48
+ if (typeof attributes.expires === 'number') {
49
+ var expires = new Date();
50
+ expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);
51
+ attributes.expires = expires;
52
+ }
53
+
54
+ try {
55
+ result = JSON.stringify(value);
56
+ if (/^[\{\[]/.test(result)) {
57
+ value = result;
58
+ }
59
+ } catch (e) {}
60
+
61
+ if (!converter.write) {
62
+ value = encodeURIComponent(String(value))
63
+ .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
64
+ } else {
65
+ value = converter.write(value, key);
66
+ }
67
+
68
+ key = encodeURIComponent(String(key));
69
+ key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
70
+ key = key.replace(/[\(\)]/g, escape);
71
+
72
+ return (document.cookie = [
73
+ key, '=', value,
74
+ attributes.expires && '; expires=' + attributes.expires.toUTCString(), // use expires attribute, max-age is not supported by IE
75
+ attributes.path && '; path=' + attributes.path,
76
+ attributes.domain && '; domain=' + attributes.domain,
77
+ attributes.secure ? '; secure' : ''
78
+ ].join(''));
79
+ }
80
+
81
+ // Read
82
+
83
+ if (!key) {
84
+ result = {};
85
+ }
86
+
87
+ // To prevent the for loop in the first place assign an empty array
88
+ // in case there are no cookies at all. Also prevents odd result when
89
+ // calling "get()"
90
+ var cookies = document.cookie ? document.cookie.split('; ') : [];
91
+ var rdecode = /(%[0-9A-Z]{2})+/g;
92
+ var i = 0;
93
+
94
+ for (; i < cookies.length; i++) {
95
+ var parts = cookies[i].split('=');
96
+ var cookie = parts.slice(1).join('=');
97
+
98
+ if (cookie.charAt(0) === '"') {
99
+ cookie = cookie.slice(1, -1);
100
+ }
101
+
102
+ try {
103
+ var name = parts[0].replace(rdecode, decodeURIComponent);
104
+ cookie = converter.read ?
105
+ converter.read(cookie, name) : converter(cookie, name) ||
106
+ cookie.replace(rdecode, decodeURIComponent);
107
+
108
+ if (this.json) {
109
+ try {
110
+ cookie = JSON.parse(cookie);
111
+ } catch (e) {}
112
+ }
113
+
114
+ if (key === name) {
115
+ result = cookie;
116
+ break;
117
+ }
118
+
119
+ if (!key) {
120
+ result[name] = cookie;
121
+ }
122
+ } catch (e) {}
123
+ }
124
+
125
+ return result;
126
+ }
127
+
128
+ api.set = api;
129
+ api.get = function (key) {
130
+ return api(key);
131
+ };
132
+ api.getJSON = function () {
133
+ return api.apply({
134
+ json: true
135
+ }, [].slice.call(arguments));
136
+ };
137
+ api.defaults = {};
138
+
139
+ api.remove = function (key, attributes) {
140
+ api(key, '', extend(attributes, {
141
+ expires: -1
142
+ }));
143
+ };
144
+
145
+ api.withConverter = init;
146
+
147
+ return api;
148
+ }
149
+
150
+ return init(function () {});
151
+ }));
lang/wk-ga-de_CH.mo ADDED
Binary file
lang/wk-ga-de_CH.po ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Google Analytics by WebKinder\n"
4
+ "POT-Creation-Date: 2016-09-14 11:31+0200\n"
5
+ "PO-Revision-Date: 2016-09-14 11:31+0200\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: \n"
8
+ "Language: de\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.8.9\n"
13
+ "X-Poedit-Basepath: ..\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-KeywordsList: __;_e\n"
17
+ "X-Poedit-SearchPath-0: wk-ga.php\n"
18
+
19
+ #: wk-ga.php:100
20
+ msgid "Page visits from this device are not tracked."
21
+ msgstr "Seitenbesuche von diesem Gerät werden nicht getrackt."
22
+
23
+ #: wk-ga.php:101
24
+ msgid "This device is treated like any other"
25
+ msgstr "Dieses Gerät wird wie jedes Andere behandelt."
26
+
27
+ #: wk-ga.php:169
28
+ msgid "Test your tracking code now!"
29
+ msgstr "Teste deinen Tracking Code jetzt!"
30
+
31
+ #: wk-ga.php:173
32
+ msgid ""
33
+ "Enter your Google Analytics tracking code below. There are two additional "
34
+ "mechanisms that allow you to stop tracking your own visits. The first one "
35
+ "checks if you are logged in as a WordPress User. The second one allows you "
36
+ "to stop tracking certain devices totally by setting a cookie."
37
+ msgstr ""
38
+ "Gib deinen Google Analytics Tracking Code unten ein. Es gibt zwei "
39
+ "zusätzliche Mechanismen, die dir erlauben deine eigenen Seitenbesuche nicht "
40
+ "mehr zu tracken. Der erste prüft, ob du als WordPress User angemeldet bist. "
41
+ "Der zweite gibt dir die Möglichkeit über ein Cookie sämtliche Seitenbesuche "
42
+ "von einem bestimmten Gerät aus nicht mehr zu tracken."
43
+
44
+ #: wk-ga.php:181
45
+ msgid "GA Tracking Code"
46
+ msgstr "GA Tracking Code"
47
+
48
+ #: wk-ga.php:185
49
+ msgid "Track logged in users"
50
+ msgstr "Eingeloggte Benutzer tracken"
51
+
52
+ #: wk-ga.php:189
53
+ msgid "Anonymize IP's"
54
+ msgstr "IP Anonymisierung"
lang/wk-ga-de_DE.mo ADDED
Binary file
lang/wk-ga-de_DE.po ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Google Analytics by WebKinder\n"
4
+ "POT-Creation-Date: 2016-09-14 11:31+0200\n"
5
+ "PO-Revision-Date: 2016-09-14 11:32+0200\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: \n"
8
+ "Language: de\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.8.9\n"
13
+ "X-Poedit-Basepath: ..\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-KeywordsList: __;_e\n"
17
+ "X-Poedit-SearchPath-0: wk-ga.php\n"
18
+
19
+ #: wk-ga.php:100
20
+ msgid "Page visits from this device are not tracked."
21
+ msgstr "Seitenbesuche von diesem Gerät werden nicht getrackt."
22
+
23
+ #: wk-ga.php:101
24
+ msgid "This device is treated like any other"
25
+ msgstr "Dieses Gerät wird wie jedes Andere behandelt."
26
+
27
+ #: wk-ga.php:169
28
+ msgid "Test your tracking code now!"
29
+ msgstr "Teste deinen Tracking Code jetzt!"
30
+
31
+ #: wk-ga.php:173
32
+ msgid ""
33
+ "Enter your Google Analytics tracking code below. There are two additional "
34
+ "mechanisms that allow you to stop tracking your own visits. The first one "
35
+ "checks if you are logged in as a WordPress User. The second one allows you "
36
+ "to stop tracking certain devices totally by setting a cookie."
37
+ msgstr ""
38
+ "Gib deinen Google Analytics Tracking Code unten ein. Es gibt zwei "
39
+ "zusätzliche Mechanismen, die dir erlauben deine eigenen Seitenbesuche nicht "
40
+ "mehr zu tracken. Der erste prüft, ob du als WordPress User angemeldet bist. "
41
+ "Der zweite gibt dir die Möglichkeit über ein Cookie sämtliche Seitenbesuche "
42
+ "von einem bestimmten Gerät aus nicht mehr zu tracken."
43
+
44
+ #: wk-ga.php:181
45
+ msgid "GA Tracking Code"
46
+ msgstr "GA Tracking Code"
47
+
48
+ #: wk-ga.php:185
49
+ msgid "Track logged in users"
50
+ msgstr "Eingeloggte Benutzer tracken"
51
+
52
+ #: wk-ga.php:189
53
+ msgid "Anonymize IP's"
54
+ msgstr "IP Anonymisierung"
readme.txt ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Google Analytics ===
2
+ Contributors: webkinder
3
+ Tags: google analytics, tracking code
4
+ Requires at least: 3.0
5
+ Tested up to: 4.6
6
+ Stable tag: 1.1
7
+ License: GPLv2 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+ Google Analytics for WordPress without tracking your own visits.
11
+
12
+ == Description ==
13
+
14
+ Enable Google Analytics on all pages without tracking your own visits. You can exclude any logged in user as well as ignore a device completely by setting a cookie.
15
+
16
+ If you have any questions or feature requests, feel free to contact us via support@webkinder.ch.
17
+
18
+ == Installation ==
19
+
20
+ 1. Upload the plugin files to the `/wp-content/plugins/wk-ga directory, or install the plugin through the WordPress plugins screen directly.
21
+ 1. Activate the plugin through the 'Plugins' screen in WordPress
22
+ 1. Use the Settings->Google Analytics screen to configure the plugin
23
+ 1. Test your Tracking Code as shown [here](https://support.google.com/analytics/answer/1008083?hl=en)
24
+
25
+ == Screenshots ==
26
+
27
+ 1.The Settings Page of this Plugin. The cookie mechanism is activated here.
28
+
29
+ == Changelog ==
30
+
31
+ = 1.0 =
32
+ * Initial release
33
+
34
+ = 1.1 =
35
+ * added anonymize IP's option
36
+ * added uninstall file
uninstall.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // If uninstall is not called from WordPress, exit
3
+ if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
4
+ exit();
5
+ }
6
+
7
+ delete_option( 'ga_tracking_code' );
8
+ delete_option( 'track_logged_in' );
9
+ delete_option( 'ga_anonymize_ip' );
10
+
11
+ // For site options in Multisite
12
+ delete_site_option( 'ga_tracking_code' );
13
+ delete_site_option( 'track_logged_in' );
14
+ delete_site_option( 'ga_anonymize_ip' );
15
+ ?>
wk-ga.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Google Analytics by WebKinder
4
+ Plugin URI: https://wordpress.org/plugins/wk-google-analytics/
5
+ Description: Google Analytics for WordPress without tracking your own visits
6
+ Version: 1.1
7
+ Author: WebKinder
8
+ Author URI: http://www.webkinder.ch
9
+ License: GPL2
10
+ License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
+ Domain Path: /lang
12
+ Text Domain: wk-ga
13
+ */
14
+
15
+ class wk_ga {
16
+ public function __construct() {
17
+
18
+ //Lifecycle hooks
19
+ register_activation_hook( __FILE__, array( $this, "activation" ) );
20
+ register_deactivation_hook( __FILE__, array( $this, "deactivation" ) );
21
+
22
+ //i18n
23
+ add_action('plugins_loaded', array( $this, "load_textdomain") );
24
+
25
+ //Settings
26
+ add_action( 'admin_init', array( $this, "register_settings" ) );
27
+ add_action( 'admin_menu', array( $this, "settings_page" ) );
28
+
29
+ //Cookie Handling
30
+ add_action( 'admin_enqueue_scripts', array( $this, "load_admin_scripts" ) );
31
+
32
+ //Load GA Code on Frontend
33
+ add_action( 'wp_footer', array( $this, "render_ga_script" ) );
34
+ }
35
+
36
+ /*
37
+ * Load Text Domain
38
+ */
39
+ function load_textdomain() {
40
+ load_plugin_textdomain( 'wk-ga', false, dirname( plugin_basename(__FILE__) ) . '/lang/' );
41
+ }
42
+
43
+ /*
44
+ * Plugin Activation
45
+ */
46
+ public function activation() {
47
+
48
+ //set setting defaults
49
+ update_option( 'track_logged_in', false );
50
+ }
51
+
52
+ /*
53
+ * Plugin Deactivation
54
+ */
55
+ public function deactivation() {
56
+
57
+ //remove cookie
58
+
59
+ }
60
+
61
+ /*
62
+ * Register Settings
63
+ */
64
+ public function register_settings() {
65
+ register_setting(
66
+ 'wk_ga_google_analytics',
67
+ 'ga_tracking_code'
68
+ );
69
+
70
+ register_setting(
71
+ 'wk_ga_google_analytics',
72
+ 'track_logged_in'
73
+ );
74
+
75
+ register_setting(
76
+ 'wk_ga_google_analytics',
77
+ 'ga_anonymize_ip'
78
+ );
79
+ }
80
+
81
+ /*
82
+ *
83
+ */
84
+ public function load_admin_scripts( $hook ) {
85
+ if( $hook != "settings_page_google_analytics" ) {
86
+ return;
87
+ }
88
+
89
+ //admin styles
90
+ wp_enqueue_style( 'custom-admin-styles', plugin_dir_url( __FILE__ ) . '/css/admin-styles.css' );
91
+
92
+ //cookie library
93
+ wp_enqueue_script( 'cookie-js', plugin_dir_url( __FILE__ ) . '/js/js.cookie.js' );
94
+
95
+ //admin js for cookies
96
+ wp_register_script( 'wk-ga-admin-js', plugin_dir_url( __FILE__ ) . '/js/admin-functions.js', array('jquery', 'cookie-js') );
97
+
98
+ //translate JavaScript
99
+ $translation_array = array(
100
+ 'UntrackText' => __('Page visits from this device are not tracked.','wk-ga'),
101
+ 'TrackText' => __('This device is treated like any other','wk-ga')
102
+ );
103
+ wp_localize_script('wk-ga-admin-js', 'text_content', $translation_array );
104
+ wp_enqueue_script('wk-ga-admin-js');
105
+
106
+ }
107
+
108
+ public function render_ga_script() {
109
+ $GA_CODE = get_option('ga_tracking_code');
110
+ $TRACK_LOGGED_IN = get_option('track_logged_in');
111
+ $ANONYMIZE_IP = get_option('ga_anonymize_ip');
112
+
113
+ if( $GA_CODE && ( (!$TRACK_LOGGED_IN && !is_user_logged_in()) || $TRACK_LOGGED_IN ) ) :
114
+ ?>
115
+
116
+ <script>
117
+
118
+ if( !
119
+ (new RegExp('wp_wk_ga_untrack_' + document.location.hostname) ).test(document.cookie)
120
+ )
121
+ {
122
+ //GA Tracking Snippet
123
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
124
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
125
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
126
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
127
+
128
+ ga('create', '<?php echo $GA_CODE; ?>', 'auto');
129
+
130
+ <?php
131
+ if( $ANONYMIZE_IP ) :
132
+ ?>
133
+ //anonymize IP
134
+ ga('set', 'anonymizeIp', true);
135
+ <?php
136
+ endif;
137
+ ?>
138
+
139
+ ga('send', 'pageview');
140
+ }
141
+ </script>
142
+
143
+ <?php
144
+
145
+ endif;
146
+ }
147
+
148
+ /*
149
+ * Settings Page
150
+ */
151
+ public function settings_page() {
152
+ add_options_page(
153
+ 'Google Analytics',
154
+ 'Google Analytics',
155
+ 'manage_options',
156
+ 'google_analytics',
157
+ array( $this, "settings_content" )
158
+ );
159
+ }
160
+
161
+ public function settings_content() {
162
+ if ( ! isset( $_REQUEST['settings-updated'] ) )
163
+ $_REQUEST['settings-updated'] = false;
164
+ ?>
165
+ <div class="wrap">
166
+ <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
167
+
168
+ <?php if ( false !== $_REQUEST['settings-updated'] ) : ?>
169
+ <div class="updated fade"><p><strong><a target="_blank" href="https://support.google.com/analytics/answer/1008083?hl=de"><?php _e( 'Test your tracking code now!', 'wk-ga' ); ?></a></strong></p>
170
+ </div>
171
+ <?php endif; ?>
172
+
173
+ <p><?php _e('Enter your Google Analytics tracking code below. There are two additional mechanisms that allow you to stop tracking your own visits. The first one checks if you are logged in as a WordPress User. The second one allows you to stop tracking certain devices totally by setting a cookie.', 'wk-ga'); ?>
174
+ </p>
175
+
176
+ <form id="wk-google-analytics-settings" method="post" action="options.php">
177
+ <?php settings_fields( 'wk_ga_google_analytics' ); ?>
178
+ <?php do_settings_sections('wk_ga_google_analytics'); ?>
179
+
180
+ <div>
181
+ <label><?php _e('GA Tracking Code', 'wk-ga'); ?></label>
182
+ <input type="text" name="ga_tracking_code" value=<?php echo esc_attr( get_option( "ga_tracking_code" ) ); ?> />
183
+ </div>
184
+ <div>
185
+ <label><?php _e('Track logged in users', 'wk-ga'); ?></label>
186
+ <input type="checkbox" name="track_logged_in" value="1" <?php checked( get_option( "track_logged_in" ) ); ?> />
187
+ </div>
188
+ <div>
189
+ <label><?php _e("Anonymize IP's", 'wk-ga'); ?></label>
190
+ <input type="checkbox" name="ga_anonymize_ip" value="1" <?php checked( get_option( "ga_anonymize_ip") ); ?> />
191
+ </div>
192
+ <?php submit_button(); ?>
193
+ </form>
194
+
195
+ <div>
196
+ <p></p>
197
+ <div id="track-device"></div>
198
+ </div>
199
+
200
+ </div>
201
+
202
+ <?php
203
+ }
204
+
205
+ }
206
+
207
+ $wk_ga = new wk_ga();
208
+
209
+ ?>