Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Frank Goossens

    (@futtta)

    Hi meam20;
    I see you’re also using mod_pagespeed, which does similar things to AO and which can interfere in some cases. In order to debug AO, it would be better to disable mod_pagespeed at least temporarily. Once that is done, have a look at your browser’s developer/ error console and copy/paste any javascript error you see there in this thread. Based on that we should be able to solve this problem.

    Kind regards,
    frank

    Thread Starter meam20

    (@meam20)

    thanks for reply
    here is the result with mod-page-speed disable and yoast Google analytics disabled too,
    SyntaxError: missing ; before statement
    http://egembuy.com/wp-content/cache/autoptimize/js/autoptimize_29ae299bd6f79cbc7ac2e6afc558ea63.js?8a8a21
    Line 7
    and here is the actual error
    http://paste.ubuntu.com/11951729/

    Plugin Author Frank Goossens

    (@futtta)

    had a look at your site and see the same error;

    07:12:56.286 SyntaxError: missing ; before statement1 data:1:11

    when looking at your page source, this is in this block of inline code:

    <script type="text/psajs" orig_index="1">{"@context":"http:\/\/schema.org","@type":"WebSite","url":"http:\/\/egembuy.com\/","name":"\u062c\u0645 \u06a9\u0644\u0634 \u0627\u0641 \u06a9\u0644\u0646\u0632 | \u0627\u0644\u0645\u0627\u0633 \u0628\u0648\u0645 \u0628\u06cc\u0686 | EGemBuy.com","potentialAction":{"@type":"SearchAction","target":"http:\/\/egembuy.com\/?s={search_term}","query-input":"required name=search_term"}}{"@context":"http:\/\/schema.org","@type":"Person","url":"http:\/\/egembuy.com\/","sameAs":["https:\/\/www.facebook.com\/egembuy","http:\/\/google.com\/+Egembuy","https:\/\/twitter.com\/EGemBuy"],"name":"Mehrzad Amiri"}(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','//www.google-analytics.com/analytics.js','__gaTracker');__gaTracker('create','UA-60988618-1','auto');__gaTracker('set','forceSSL',true);__gaTracker('send','pageview');var ajaxurl="http://egembuy.com/wp-admin/admin-ajax.php"</script>

    the problem is that this one block contains both script that is of type ‘application/ld+json’ (the first part, with schema.org references) and ‘text/javascript’ (the google analytics-part). these two are never supposed to be joined, the ld+json script needs to stay seperate as it isn’t executable JS. if something changes ‘application/ld+json’ into ‘text/javascript’, then indeed AO will aggregate and this will break things.

    frank

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

The topic ‘JS minification not work after disabling google analytics plugin!’ is closed to new replies.