Changeset 709542
- Timestamp:
- 05/07/2013 08:50:38 PM (13 years ago)
- Location:
- segmentio/trunk
- Files:
-
- 6 edited
-
.gitignore (modified) (1 diff)
-
Makefile (modified) (1 diff)
-
analytics-wordpress.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
templates/identify.php (modified) (1 diff)
-
templates/track.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
segmentio/trunk/.gitignore
r661998 r709542 1 .DS_Store2 *.sublime*3 1 test -
segmentio/trunk/Makefile
r661979 r709542 2 2 # Open the WordPress site and admin. 3 3 test: 4 open http://localhost:8888/ wp-admin/options-general.php?page=analytics-wordpress5 open http://localhost:8888/ 4 open http://localhost:8888/analytics-wordpress/test/wp-admin/options-general.php?page=analytics-wordpress 5 open http://localhost:8888/analytics-wordpress/test/ 6 6 7 7 # Turns the testing plugin into a real folder, for more accurate testing. -
segmentio/trunk/analytics-wordpress.php
r683366 r709542 5 5 Description: The hassle-free way to integrate any analytics service into your Wordpress site. 6 6 7 Version: 0.5. 17 Version: 0.5.2 8 8 License: GPLv2 9 9 … … 31 31 32 32 // Render a Javascript `identify` call. 33 public function identify($user_id, $traits = false) { 33 public function identify($user_id, $traits = array(), $options = array()) { 34 // A user ID is required. 34 35 if (!$user_id) return; 36 37 // Set the proper `library` option so we know where the API calls come from. 38 $options['library'] = 'analytics-wordpress'; 39 35 40 include(plugin_dir_path(__FILE__) . 'templates/identify.php'); 36 41 } 37 42 38 43 // Render a Javascript `track` call. 39 public function track($event, $properties = false) { 44 public function track($event, $properties = array(), $options = array()) { 45 // An event is required. 40 46 if (!$event) return; 47 48 // Set the proper `library` option so we know where the API calls come from. 49 $options['library'] = 'analytics-wordpress'; 50 41 51 include(plugin_dir_path(__FILE__) . 'templates/track.php'); 42 52 } -
segmentio/trunk/readme.txt
r683366 r709542 4 4 Requires at least: 3.4 5 5 Tested up to: 3.5.1 6 Stable tag: 0.5. 16 Stable tag: 0.5.2 7 7 License: GPLv2 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 55 55 == Changelog == 56 56 57 = 0.5.2 = 58 * Added `'analytics-wordpress'` `library` option. 59 57 60 = 0.5.1 = 58 61 * Fixed a bug where the user permission level would be output. -
segmentio/trunk/templates/identify.php
r680923 r709542 1 1 <script type="text/javascript"> 2 analytics.identify(<?php echo "'" . $user_id . "'"; if ($traits) echo ', ' . json_encode($traits); ?>);2 analytics.identify(<?php echo '"' . $user_id . '"' ?>, <?php echo json_encode($traits, JSON_FORCE_OBJECT); ?>, <?php echo json_encode($options, JSON_FORCE_OBJECT); ?>); 3 3 </script> -
segmentio/trunk/templates/track.php
r680923 r709542 1 1 <script type="text/javascript"> 2 analytics.track(<?php echo "'" . $event . "'"; if ($properties) echo ', ' . json_encode($properties); ?>);2 analytics.track(<?php echo '"' . $event . '"' ?>, <?php echo json_encode($properties, JSON_FORCE_OBJECT); ?>, <?php echo json_encode($options, JSON_FORCE_OBJECT); ?>); 3 3 </script>
Note: See TracChangeset
for help on using the changeset viewer.