WordPress.org

Support

Support » Plugins and Hacks » Google Analytics by MonsterInsights » prevent JS error on frontend

prevent JS error on frontend

  • Hi, you should edit your str_clean function in “class-frontend.php” as follow:

    /**
    * Cleans the variable to make it ready for storing in Google Analytics
    */
    function str_clean( $val ) {
    	return remove_accents( str_replace( '---', '-', str_replace( "'", "\'", str_replace( ' ', '-', strtolower( html_entity_decode( $val ) ) ) ) ) );
    }

    This will avoid JS error when, for example, author public name contains a non typographic apostrophe.

    🙂

    http://wordpress.org/plugins/google-analytics-for-wordpress/

  • The topic ‘prevent JS error on frontend’ is closed to new replies.
Skip to toolbar