Changeset 1640953
- Timestamp:
- 04/19/2017 11:20:35 PM (9 years ago)
- Location:
- simple-google-analytics-tracking
- Files:
-
- 10 added
- 4 edited
-
tags/1.3 (added)
-
tags/1.3/LICENSE.txt (added)
-
tags/1.3/README.txt (added)
-
tags/1.3/includes (added)
-
tags/1.3/includes/index.php (added)
-
tags/1.3/includes/simple-ga-tracking-input.php (added)
-
tags/1.3/includes/simple-ga-tracking-output.php (added)
-
tags/1.3/index.php (added)
-
tags/1.3/simple-google-analytics-tracking.php (added)
-
tags/1.3/uninstall.php (added)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/includes/simple-ga-tracking-input.php (modified) (1 diff)
-
trunk/includes/simple-ga-tracking-output.php (modified) (2 diffs)
-
trunk/simple-google-analytics-tracking.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
simple-google-analytics-tracking/trunk/README.txt
r1299202 r1640953 3 3 Tags: google, analytics, google analytics, simple, tracking, google analytics tracking, simple google analytics tracking, sgat, simple google analytics, simple tracking 4 4 Requires at least: 3.8 5 Tested up to: 4. 3.16 Stable tag: 1. 2.15 Tested up to: 4.7.3 6 Stable tag: 1.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 34 34 Yes, the Tracking ID can be changed with the `sgat_tracking_id` filter. 35 35 36 = Can the Tracking Fields be added programatically? = 37 38 Yes, the Tracking Fields can be changed with the `sgat_tracker_create_fields` filter. 39 40 = Can additional tracking calls be added after Google Analytics? = 41 42 Yes, additional tracking calls be added after Google Analytics is added with the `sgat_after_tracker` action. 43 36 44 == Screenshots == 37 45 … … 62 70 } 63 71 ` 72 73 `sgat_tracker_create_fields `: Used to modify the information when creating the Google Analytics tracker. 74 75 Example Usage: 76 ` 77 add_filter( 'sgat_tracker_create_fields', 'sgat_custom_tracker_create_fields' ); 78 function sgat_custom_tracker_create_fields( $fields ) { 79 $fields['siteSpeedSampleRate'] = 50; 80 return $fields; 81 } 82 ` 83 84 `sgat_after_tracker `: Used to add additional Google Analytics calls after the main tracker output. 85 86 Example Usage: 87 ` 88 add_action( 'sgat_after_tracker', 'sgat_after_tracker_functionality’ ); 89 function sgat_after_tracker_functionality() { 90 echo "ga('send', 'event', 'MyCategory', 'MyAction', 'MyLabel', 50);"; 91 } 92 ` -
simple-google-analytics-tracking/trunk/includes/simple-ga-tracking-input.php
r1299202 r1640953 5 5 6 6 function sgat_add_option() { 7 add_options_page( 'Google Anal tics', 'Google Analytics', 'manage_options', 'simple-google-analytics-tracking.php', 'sgat_admin_input' );7 add_options_page( 'Google Analytics', 'Google Analytics', 'manage_options', 'simple-google-analytics-tracking.php', 'sgat_admin_input' ); 8 8 } 9 9 -
simple-google-analytics-tracking/trunk/includes/simple-ga-tracking-output.php
r1098390 r1640953 7 7 8 8 $tracking_id = apply_filters( 'sgat_tracking_id', get_option("sgat_tracking_code") ); 9 9 $create_options = apply_filters( 'sgat_tracker_create_fields', array( 10 'cookieDomain' => 'auto', 11 'trackingId' => $tracking_id, 12 ) ); 13 10 14 if( 11 15 !empty( $tracking_id ) // There is a tracking code … … 20 24 })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); 21 25 22 ga('create', '<?php echo esc_attr( $tracking_id ); ?>', 'auto');26 ga('create', <?php echo json_encode( $create_options ); ?> ); 23 27 ga('send', 'pageview'); 28 <?php do_action( 'sgat_after_tracker' ); ?> 24 29 25 30 </script> -
simple-google-analytics-tracking/trunk/simple-google-analytics-tracking.php
r1098390 r1640953 5 5 Description: Add Google Analytics Tracking to your site easily with your Tracking ID. 6 6 Author: Dustyn Doyle 7 Version: 1. 27 Version: 1.3 8 8 Author URI: http://www.dustyndoyle.com 9 9 */ 10 /* Copyright 201 5dustyn (email : dustyn_doyle@yahoo.com)10 /* Copyright 2017 dustyn (email : dustyn_doyle@yahoo.com) 11 11 12 12 This program is free software; you can redistribute it and/or modify
Note: See TracChangeset
for help on using the changeset viewer.