Changeset 1446875
- Timestamp:
- 06/30/2016 11:01:09 PM (10 years ago)
- Location:
- hubspot-tracking-code/trunk/inc
- Files:
-
- 3 edited
-
class-hubspot-tracking-code-analytics.php (modified) (6 diffs)
-
class-hubspot-tracking-code.php (modified) (1 diff)
-
hubspot-tracking-code-functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hubspot-tracking-code/trunk/inc/class-hubspot-tracking-code-analytics.php
r1446872 r1446875 1 1 <?php 2 class HubSpotTrackingCodeAnalytics 2 class HubSpotTrackingCodeAnalytics 3 3 { 4 function HubSpotTrackingCodeAnalytics () 4 function HubSpotTrackingCodeAnalytics () 5 5 { 6 6 add_action('wp_footer', array(&$this, 'hubspot_analytics_insert')); … … 22 22 { 23 23 // Identify the current user if logged in 24 if ( $current_user->user_email ) 24 if ( $current_user->user_email ) 25 25 { 26 26 $hs_identify_name = $current_user->user_login; 27 27 $hs_identify_email = $current_user->user_email; 28 28 $hs_identify_id = md5($current_user->user_email); 29 } 30 else 29 } 30 else 31 31 { 32 32 $commenter = wp_get_current_commenter(); 33 if ( $commenter['comment_author_email'] ) 33 if ( $commenter['comment_author_email'] ) 34 34 { 35 35 $hs_identify_name = $commenter['comment_author']; … … 39 39 } 40 40 41 if ( isset($hs_identify_email) ) 41 if ( isset($hs_identify_email) ) 42 42 { 43 43 echo "\n" . '<!-- DO NOT COPY THIS SNIPPET! -- HubSpot User Identification Code -->' . "\n"; … … 45 45 echo "(function(d,w) {\n"; 46 46 // Wrap `identify` call in hubspotutk check to help prevent accidental copy-paste 47 if ( isset($_COOKIE['hubspotutk']) ) 47 if ( isset($_COOKIE['hubspotutk']) ) 48 48 { 49 49 echo "var match = d.cookie.match('(^|;) ?hubspotutk=([^;]*)(;|$)');\n"; … … 56 56 echo " \"id\" : \"" . $hs_identify_id . "\"\n"; 57 57 echo "}]);\n"; 58 if ( isset($_COOKIE['hubspotutk']) ) 58 if ( isset($_COOKIE['hubspotutk']) ) 59 59 { 60 60 echo "}\n"; … … 69 69 echo 'var _hsq = _hsq || [];' . "\n"; 70 70 // Pass along the correct content-type 71 if ( is_singular('post') ) 71 if ( is_singular('post') ) 72 72 { 73 echo '_hsq.push(["setContentType", "blog-post"]);' . "\n"; 74 } 73 echo '_hsq.push(["setContentType", "blog-post"]);' . "\n"; 74 } 75 75 else if ( is_archive () || is_search() ) 76 76 { 77 77 echo '_hsq.push(["setContentType", "listing-page"]);' . "\n"; 78 } 79 else 78 } 79 else 80 80 { 81 81 echo '_hsq.push(["setContentType", "standard-page"]);' . "\n"; -
hubspot-tracking-code/trunk/inc/class-hubspot-tracking-code.php
r1208526 r1446875 33 33 return FALSE; 34 34 35 $html = ''; 35 $html = ''; 36 36 if ( ! isset($options['hs_portal']) || ( isset($options['hs_portal']) && ! $options['hs_portal'] ) ) 37 { 37 { 38 38 $html = '<div class="updated" style="border-color: #f47621">'; 39 39 $html .= '<p>'; -
hubspot-tracking-code/trunk/inc/hubspot-tracking-code-functions.php
r1208526 r1446875 1 1 <?php 2 2 3 if ( !defined('HUBSPOT_TRACKING_CODE_PLUGIN_VERSION') ) 3 if ( !defined('HUBSPOT_TRACKING_CODE_PLUGIN_VERSION') ) 4 4 { 5 5 header('HTTP/1.0 403 Forbidden'); … … 16 16 * @return bool True if option value has changed, false if not or if update failed. 17 17 */ 18 function hubspot_tracking_code_update_option ( $option, $option_key, $new_value ) 18 function hubspot_tracking_code_update_option ( $option, $option_key, $new_value ) 19 19 { 20 20 $options_array = get_option($option); … … 48 48 if ( is_array($message) || is_object($message) ) 49 49 error_log(print_r($message, TRUE)); 50 else 50 else 51 51 error_log($message); 52 52 }
Note: See TracChangeset
for help on using the changeset viewer.