WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics by Yoast
prevent JS error on frontend (1 post)

  1. giambo
    Member
    Posted 1 year ago #

    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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.