Changeset 201709
- Timestamp:
- 02/04/2010 07:53:40 AM (15 years ago)
- Location:
- woopra/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
woopra/trunk/inc/frontend.php
r201175 r201709 56 56 function init() { 57 57 58 59 60 61 62 63 64 65 58 66 /** 59 67 * WordPress Woopra Event Tracking … … 65 73 66 74 if ( $this->enabled_event('comments') ) 67 $this->create_localize( array('trackComments' => 'true', 'trackCommentsTitle' => __('Comment Posted')), 'woopra-events' ); 68 75 $this->create_localize( array('trackComments' => 'true', 'trackCommentsTitle' => __('Comment Posted')), 'woopra-events' ); 69 76 70 77 if ( is_array($this->local['woopra-events']) ) 71 78 wp_enqueue_script( 'woopra-events', $this->plugin_url() . '/js/jquery.events.js', array('jquery', 'woopra-tracking'), '20100201', true ); 79 72 80 wp_localize_script( 'woopra-events', 'woopraEventsL10n', $this->local['woopra-events'] ); 73 81 } … … 83 91 $this->create_localize( array('setTimeoutValue' => ($this->get_option('timeout')*1000) ), 'woopra-tracking' ); 84 92 85 $this->create_localize( array('name' => 'Name'), 'woopra-tracking' );86 $this->create_localize( array('email' => 'email'), 'woopra-tracking' );87 93 wp_localize_script( 'woopra-tracking', 'woopraFrontL10n', $this->local['woopra-tracking'] ); 88 94 … … 154 160 function widget() { 155 161 162 156 163 if ( !$this->get_status() || $this->get_admin() ) 164 165 166 167 157 168 return; 158 169 -
woopra/trunk/js/jquery.tracking.js
r201175 r201709 1 1 /* 2 * jQuery Woopra Analytics Plugin 3 * 4 * A jQuery plugin that makes it easier to implement Woopra tracking for your site. 2 * jQuery Woopra Analytics Plugin (jquery.tracking.js) 3 * 4 * A jQuery plugin that makes it easier to implement Woopra tracking for your site 5 * and allows you to add your own Woopra Tracking Events to the system to follow. 5 6 * 6 7 * Adds the following methods to jQuery: … … 12 13 * 13 14 * Copyright (c) 2009 Pranshu Arya 14 * Modified by Shane <shane@bugssite.org> to work for the WordPress Woopra Plugin15 * Modified by Shane <shane@bugssite.org> to work for 15 16 * 16 * Version 1. 217 * Version 1. 17 18 ** 18 19 * Licensed under the MIT license: … … 24 25 * - http://pranshuarya.com/jaal/Development/jquery-woopra-plugin.html 25 26 */ 26 27 27 (function($) { 28 28 … … 46 46 function _woopra_track() { 47 47 if ( woopraTracker != undefined ) { 48 if ( woopraFrontL10n.rootDomain != null ) { 49 woopraTracker.setDomain( woopraFrontL10n.rootDomain ); 50 debug('Woopra Root Domain: ' + woopraFrontL10n.rootDomain); 48 if ( typeof woopraFrontL10n != "undefined" ) { 49 if ( woopraFrontL10n.rootDomain != null ) { 50 woopraTracker.setDomain( woopraFrontL10n.rootDomain ); 51 debug('Woopra Root Domain: ' + woopraFrontL10n.rootDomain); 52 } 53 if ( woopraFrontL10n.setTimeoutValue > 0 ) { 54 woopraTracker.setIdleTimeout( woopraFrontL10n.setTimeoutValue ); 55 debug('Woopra Idle Timeout: ' + woopraFrontL10n.setTimeoutValue + 'ms'); 56 } 51 57 } 52 if ( woopraFrontL10n.setTimeoutValue > 0 ) { 53 woopraTracker.setIdleTimeout( woopraFrontL10n.setTimeoutValue ); 54 debug('Woopra Idle Timeout: ' + woopraFrontL10n.setTimeoutValue + 'ms'); 58 // Only run when we have data. 59 if ( woopra_data.name != null ) { 60 woopraTracker.addVisitorProperty( 'name' , woopra_data.name ); 61 woopraTracker.addVisitorProperty( 'email' , woopra_data.email ); 62 woopraTracker.addVisitorProperty( 'avatar', woopra_data.avatar ); 55 63 } 56 woopraTracker.addVisitorProperty( woopraFrontL10n.name , woopra_data.name );57 woopraTracker.addVisitorProperty( woopraFrontL10n.email , woopra_data.email );58 woopraTracker.addVisitorProperty( 'avatar', woopra_data.avatar );59 64 woopraTracker.track(); 60 65 debug('Woopra is loaded.'); … … 114 119 $.fn.trackEvent = function(woopra_options) { 115 120 116 /**117 *118 */119 121 return this.each( function () { 120 122 var element = $(this); 121 123 var parent = $(element).parent(); 122 124 123 125 // Prevent an element from being tracked multiple times. 124 126 if ( element.hasClass('w_tracked') ) { … … 179 181 */ 180 182 function evaluate(element, text_or_function) { 181 if (typeof text_or_function == 'function') {183 if) { 182 184 text_or_function = text_or_function(element); 183 185 }
Note: See TracChangeset
for help on using the changeset viewer.