WordPress.org

Plugin Directory

Changeset 1699089


Ignore:
Timestamp:
07/19/17 16:49:42 (5 months ago)
Author:
themeblvd
Message:

1.1.1

Location:
simple-analytics
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • simple-analytics/trunk/readme.txt

    r1698512 r1699089  
    44Contributors: themeblvd 
    55Tags: google, analytics, tracking, Theme Blvd, themeblvd, Jason Bobich 
    6 Stable Tag: 1.1.0 
     6Stable Tag: 1.1.1 
    77 
    88A simple plugin to include your Google Analytics tracking. 
     
    2828== Changelog == 
    2929 
     30= 1.1.1 = 
     31 
     32* Fixed: Location of anonymizeIp code. 
     33 
    3034= 1.1.0 = 
    3135 
  • simple-analytics/trunk/simple-analytics.php

    r1698512 r1699089  
    33 * Plugin Name: Simple Analytics 
    44 * Description: A simple plugin to include your Google Analytics tracking. 
    5  * Version: 1.1.0 
     5 * Version: 1.1.1 
    66 * Author: Theme Blvd 
    77 * Author URI: http://themeblvd.com 
     
    2727 */ 
    2828 
    29 define( 'TB_SIMPLE_ANALYTICS_PLUGIN_VERSION', '1.1.0' ); 
     29define( 'TB_SIMPLE_ANALYTICS_PLUGIN_VERSION', '1.1.1' ); 
    3030define( 'TB_SIMPLE_ANALYTICS_TWEEPLE_PLUGIN_DIR', dirname( __FILE__ ) ); 
    3131define( 'TB_SIMPLE_ANALYTICS_PLUGIN_URI', plugins_url( '' , __FILE__ ) ); 
     
    121121        if ( ! empty( $settings['google_id'] ) ) { 
    122122 
     123            $google_id = esc_attr( $settings['google_id'] ); 
     124 
     125            // Generate ga() JS code. 
     126            $ga = "ga('create', '{$google_id}', 'auto');\n"; 
     127 
     128            if ( ! empty( $settings['anonymize'] ) ) { 
     129 
     130                $ga .= "\tga('set', 'anonymizeIp', true);\n"; 
     131 
     132            } 
     133 
     134            $ga .= "\tga('send', 'pageview');\n"; 
     135 
     136            // Start output. 
    123137            echo "<!-- Simple Analytics by Theme Blvd -->\n"; 
    124138 
     
    136150    })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); 
    137151 
    138     ga('create', '<?php echo esc_attr( $settings['google_id'] ); ?>', 'auto'); 
    139     ga('send', 'pageview'); 
    140     <?php 
    141     if ( ! empty( $settings['anonymize'] ) ) { 
    142  
    143         echo "ga('set', 'anonymizeIp', true);\n"; 
    144  
    145     } 
    146     ?> 
     152    <?php echo wp_kses( $ga, array() ); ?> 
    147153 
    148154</script> 
Note: See TracChangeset for help on using the changeset viewer.