Title: Missing Quotation Mark on google-analytics.com/analytics.js
Last modified: September 4, 2019

---

# Missing Quotation Mark on google-analytics.com/analytics.js

 *  Resolved [mystyleplatform](https://wordpress.org/support/users/mystyleplatform/)
 * (@mystyleplatform)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/missing-quotation-mark-on-google-analytics-com-analytics-js/)
 * Please view source on the example page and notice the line 210 where the plugin
   is dropping the Google Analytics tracking code to the page. There seems to be
   a missing quotation mark right before //www.google-analytics.jsga.
 * This is throwing errors in Google Tag Manager checks as well as JS errors in 
   the console.
 * Thanks,
 * – Sean
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmissing-quotation-mark-on-google-analytics-com-analytics-js%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [mystyleplatform](https://wordpress.org/support/users/mystyleplatform/)
 * (@mystyleplatform)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/missing-quotation-mark-on-google-analytics-com-analytics-js/#post-11897306)
 * Error in console is (index):211 Uncaught SyntaxError: missing ) after argument
   list
 *  Thread Starter [mystyleplatform](https://wordpress.org/support/users/mystyleplatform/)
 * (@mystyleplatform)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/missing-quotation-mark-on-google-analytics-com-analytics-js/#post-11897396)
 * I was able to patch this issue in file class-wc-google-analytics.php in your 
   plugin by changing the line to include the protocol in the url, like:
 *     ```
       		$ga_snippet_head = "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
       		(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
       		m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
       		})(window,document,'script','https://www.google-analytics.com/analytics.js','" . self::tracker_var() . "');";
       ```
   
 *  [Matt Rose](https://wordpress.org/support/users/boswall/)
 * (@boswall)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/missing-quotation-mark-on-google-analytics-com-analytics-js/#post-11898063)
 * If your site uses the `woocommerce_google_analytics_script_src` filter then I
   suggest that you patch `/includes/class-wc-google-analytics-js.php` with the 
   following:
 *     ```
       $ga_snippet_head = "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
       (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
       m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
       })(window,document,'script', '$src', '" . self::tracker_var() . "');";
       ```
   
 * (starting at line 243)
 *  Thread Starter [mystyleplatform](https://wordpress.org/support/users/mystyleplatform/)
 * (@mystyleplatform)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/missing-quotation-mark-on-google-analytics-com-analytics-js/#post-11911797)
 * We’re not using that filter, we’re just using WooCommerce Analytics and the popular
   Monster Insights analytics plugin. It looks like there was a patch released recently(
   1.4.14) and lists the missing quotation mark as the only update, so I imagine
   this is fixed. I will test soon.
 *  Thread Starter [mystyleplatform](https://wordpress.org/support/users/mystyleplatform/)
 * (@mystyleplatform)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/missing-quotation-mark-on-google-analytics-com-analytics-js/#post-11923073)
 * Upgraded to 1.4.14 and tested. I can verify this issue is fixed for me. Closing
   this ticket.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Missing Quotation Mark on google-analytics.com/analytics.js’ is closed
to new replies.

 * ![](https://ps.w.org/woocommerce-google-analytics-integration/assets/icon-256x256.
   png?rev=3234358)
 * [Google Analytics for WooCommerce](https://wordpress.org/plugins/woocommerce-google-analytics-integration/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-google-analytics-integration/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-google-analytics-integration/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-google-analytics-integration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-google-analytics-integration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-google-analytics-integration/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [mystyleplatform](https://wordpress.org/support/users/mystyleplatform/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/missing-quotation-mark-on-google-analytics-com-analytics-js/#post-11923073)
 * Status: resolved