{"id":913,"date":"2015-01-25T11:37:05","date_gmt":"2015-01-25T10:37:05","guid":{"rendered":"https:\/\/vielhuber.de\/?p=913"},"modified":"2017-03-25T23:07:08","modified_gmt":"2017-03-25T22:07:08","slug":"google-pagespeed-insights-vs-google-analytics","status":"publish","type":"post","link":"https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/","title":{"rendered":"Google PageSpeed Insights vs. Google Analytics"},"content":{"rendered":"<p>Validation-Tools wie der <a href=\"http:\/\/validator.w3.org\/check?uri=https%3A%2F%2Fvielhuber.de%2F\" target=\"_blank\">W3C Markup Validation Service<\/a> oder <a href=\"https:\/\/developers.google.com\/speed\/pagespeed\/insights\/?url=https%3A%2F%2Fvielhuber.de\" target=\"_blank\">Google PageSpeed Insights<\/a> sind hilfreich, Code und Performance einer Webseite objektiv bewerten zu lassen. Speziell Google beeinflusst mit Konzepten wie <a href=\"https:\/\/developers.google.com\/speed\/docs\/insights\/BlockingJS?hl=de\" target=\"_blank\">above the fold<\/a>\u00a0eine ganze Branche\u00a0\u2013 und gibt auch in Sachen Bildkompression und Caching\u00a0strenge aber n\u00fctzliche Richtlinien vor. Dabei kann es aber passieren, dass sich Google selbst auf die F\u00fc\u00dfe tritt.<\/p>\n<p><!--more--><\/p>\n<p>Wird der JavaScript-Tracking-Code<\/p>\n<pre>  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\r\n  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\r\n  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\r\n  })(window,document,'script','\/\/www.google-analytics.com\/analytics.js','ga');\r\n\r\n  ga('create', 'UA-12350231-1', 'auto');\r\n  ga('send', 'pageview');<\/pre>\n<p>von Google Analytics wie <a href=\"https:\/\/support.google.com\/analytics\/answer\/1008080?hl=en-GB\" target=\"_blank\">offiziell beschrieben<\/a> auf der Webseite integriert, meckert Google \u00fcber fehlendes <a href=\"https:\/\/developers.google.com\/speed\/docs\/insights\/LeverageBrowserCaching\" target=\"_blank\">Browser-Caching<\/a>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-925 size-full aligncenter\" src=\"https:\/\/vielhuber.de\/wp-content\/uploads\/Unbenannt-22.jpg\" alt=\"Google PageSpeed Insights vs. Google Analytics\" width=\"817\" height=\"264\" \/><\/p>\n<p>Leider kann dies technisch nur der Hoster der Datei, also in dem Fall Google selbst, korrigieren und eine Behebung ist nur mit folgendem Workaround m\u00f6glich: Zun\u00e4chst biegt man die\u00a0URL<\/p>\n<pre>(window,document,'script','\/\/www.google-analytics.com\/analytics.js','ga');<\/pre>\n<p>auf den eigenen Server um<\/p>\n<pre>(window,document,'script','analytics.js','ga');<\/pre>\n<p>und richtet einen einfachen Cronjob via PHP ein, der die aktuellste .js-Datei jeden Tag frisch auf den eigenen Server herunterl\u00e4dt:<\/p>\n<pre>file_put_contents(\"analytics.js\", fopen(\"https:\/\/www.google-analytics.com\/analytics.js\", 'r'));<\/pre>\n<p>Danach kann man das Caching fein einstellen, sodass PageSpeed den Fehler fortan nicht mehr bem\u00e4ngelt:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-915 size-full\" src=\"https:\/\/vielhuber.de\/wp-content\/uploads\/Unbenannt-3.jpg\" alt=\"Google PageSpeed Insights vs. Google Analytics\" width=\"453\" height=\"255\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Validation-Tools wie der W3C Markup Validation Service oder Google PageSpeed Insights sind hilfreich, Code und Performance einer Webseite objektiv bewerten zu lassen. Speziell Google beeinflusst mit Konzepten wie above the fold\u00a0eine ganze Branche\u00a0\u2013 und gibt auch in Sachen Bildkompression und Caching\u00a0strenge aber n\u00fctzliche Richtlinien vor. Dabei kann es aber passieren, dass sich Google selbst auf [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"gtbabel_prevent_lngs":"","gtbabel_alt_lng":"","footnotes":""},"categories":[1],"tags":[],"class_list":{"0":"post-913","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-blog"},"acf":[],"yoast_head":"<title>Google PageSpeed Insights vs. Google Analytics<\/title>\n<meta name=\"description\" content=\"Validation-Tools wie der W3C Markup Validation Service oder Google PageSpeed Insights sind hilfreich, Code und Performance einer Webseite objektiv\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Google PageSpeed Insights vs. Google Analytics\" \/>\n<meta property=\"og:description\" content=\"Validation-Tools wie der W3C Markup Validation Service oder Google PageSpeed Insights sind hilfreich, Code und Performance einer Webseite objektiv\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/\" \/>\n<meta property=\"og:site_name\" content=\"Vielhuber David\" \/>\n<meta property=\"article:published_time\" content=\"2015-01-25T10:37:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-03-25T22:07:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/vielhuber.de\/wp-content\/uploads\/Unbenannt-22.jpg\" \/>\n<meta name=\"author\" content=\"David\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vielhuber\" \/>\n<meta name=\"twitter:site\" content=\"@vielhuber\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"David\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\u00a0Minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/google-pagespeed-insights-vs-google-analytics\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/google-pagespeed-insights-vs-google-analytics\\\/\"},\"author\":{\"name\":\"David\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#\\\/schema\\\/person\\\/64d4ff14713d413ea4d9b210d0c2c6ef\"},\"headline\":\"Google PageSpeed Insights vs. Google Analytics\",\"datePublished\":\"2015-01-25T10:37:05+00:00\",\"dateModified\":\"2017-03-25T22:07:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/google-pagespeed-insights-vs-google-analytics\\\/\"},\"wordCount\":161,\"publisher\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#\\\/schema\\\/person\\\/64d4ff14713d413ea4d9b210d0c2c6ef\"},\"image\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/google-pagespeed-insights-vs-google-analytics\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/vielhuber.de\\\/wp-content\\\/uploads\\\/Unbenannt-22.jpg\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"de\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/google-pagespeed-insights-vs-google-analytics\\\/\",\"url\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/google-pagespeed-insights-vs-google-analytics\\\/\",\"name\":\"Google PageSpeed Insights vs. Google Analytics\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/google-pagespeed-insights-vs-google-analytics\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/google-pagespeed-insights-vs-google-analytics\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/vielhuber.de\\\/wp-content\\\/uploads\\\/Unbenannt-22.jpg\",\"datePublished\":\"2015-01-25T10:37:05+00:00\",\"dateModified\":\"2017-03-25T22:07:08+00:00\",\"description\":\"Validation-Tools wie der W3C Markup Validation Service oder Google PageSpeed Insights sind hilfreich, Code und Performance einer Webseite objektiv\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/google-pagespeed-insights-vs-google-analytics\\\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vielhuber.de\\\/blog\\\/google-pagespeed-insights-vs-google-analytics\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/google-pagespeed-insights-vs-google-analytics\\\/#primaryimage\",\"url\":\"https:\\\/\\\/vielhuber.de\\\/wp-content\\\/uploads\\\/Unbenannt-22.jpg\",\"contentUrl\":\"https:\\\/\\\/vielhuber.de\\\/wp-content\\\/uploads\\\/Unbenannt-22.jpg\",\"width\":817,\"height\":264},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/google-pagespeed-insights-vs-google-analytics\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vielhuber.de\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Google PageSpeed Insights vs. Google Analytics\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#website\",\"url\":\"https:\\\/\\\/vielhuber.de\\\/\",\"name\":\"Vielhuber David\",\"description\":\"Full-Stack Developer\",\"publisher\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#\\\/schema\\\/person\\\/64d4ff14713d413ea4d9b210d0c2c6ef\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vielhuber.de\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#\\\/schema\\\/person\\\/64d4ff14713d413ea4d9b210d0c2c6ef\",\"name\":\"David\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/wp-content\\\/uploads\\\/about.jpg\",\"url\":\"https:\\\/\\\/vielhuber.de\\\/wp-content\\\/uploads\\\/about.jpg\",\"contentUrl\":\"https:\\\/\\\/vielhuber.de\\\/wp-content\\\/uploads\\\/about.jpg\",\"width\":700,\"height\":552,\"caption\":\"David\"},\"logo\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/wp-content\\\/uploads\\\/about.jpg\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/vielhuber\"]}]}<\/script>","yoast_head_json":{"title":"Google PageSpeed Insights vs. Google Analytics","description":"Validation-Tools wie der W3C Markup Validation Service oder Google PageSpeed Insights sind hilfreich, Code und Performance einer Webseite objektiv","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/","og_locale":"de_DE","og_type":"article","og_title":"Google PageSpeed Insights vs. Google Analytics","og_description":"Validation-Tools wie der W3C Markup Validation Service oder Google PageSpeed Insights sind hilfreich, Code und Performance einer Webseite objektiv","og_url":"https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/","og_site_name":"Vielhuber David","article_published_time":"2015-01-25T10:37:05+00:00","article_modified_time":"2017-03-25T22:07:08+00:00","og_image":[{"url":"https:\/\/vielhuber.de\/wp-content\/uploads\/Unbenannt-22.jpg","type":"","width":"","height":""}],"author":"David","twitter_card":"summary_large_image","twitter_creator":"@vielhuber","twitter_site":"@vielhuber","twitter_misc":{"Verfasst von":"David","Gesch\u00e4tzte Lesezeit":"1\u00a0Minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/#article","isPartOf":{"@id":"https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/"},"author":{"name":"David","@id":"https:\/\/vielhuber.de\/#\/schema\/person\/64d4ff14713d413ea4d9b210d0c2c6ef"},"headline":"Google PageSpeed Insights vs. Google Analytics","datePublished":"2015-01-25T10:37:05+00:00","dateModified":"2017-03-25T22:07:08+00:00","mainEntityOfPage":{"@id":"https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/"},"wordCount":161,"publisher":{"@id":"https:\/\/vielhuber.de\/#\/schema\/person\/64d4ff14713d413ea4d9b210d0c2c6ef"},"image":{"@id":"https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/#primaryimage"},"thumbnailUrl":"https:\/\/vielhuber.de\/wp-content\/uploads\/Unbenannt-22.jpg","articleSection":["Blog"],"inLanguage":"de"},{"@type":"WebPage","@id":"https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/","url":"https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/","name":"Google PageSpeed Insights vs. Google Analytics","isPartOf":{"@id":"https:\/\/vielhuber.de\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/#primaryimage"},"image":{"@id":"https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/#primaryimage"},"thumbnailUrl":"https:\/\/vielhuber.de\/wp-content\/uploads\/Unbenannt-22.jpg","datePublished":"2015-01-25T10:37:05+00:00","dateModified":"2017-03-25T22:07:08+00:00","description":"Validation-Tools wie der W3C Markup Validation Service oder Google PageSpeed Insights sind hilfreich, Code und Performance einer Webseite objektiv","breadcrumb":{"@id":"https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/#primaryimage","url":"https:\/\/vielhuber.de\/wp-content\/uploads\/Unbenannt-22.jpg","contentUrl":"https:\/\/vielhuber.de\/wp-content\/uploads\/Unbenannt-22.jpg","width":817,"height":264},{"@type":"BreadcrumbList","@id":"https:\/\/vielhuber.de\/blog\/google-pagespeed-insights-vs-google-analytics\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vielhuber.de\/"},{"@type":"ListItem","position":2,"name":"Google PageSpeed Insights vs. Google Analytics"}]},{"@type":"WebSite","@id":"https:\/\/vielhuber.de\/#website","url":"https:\/\/vielhuber.de\/","name":"Vielhuber David","description":"Full-Stack Developer","publisher":{"@id":"https:\/\/vielhuber.de\/#\/schema\/person\/64d4ff14713d413ea4d9b210d0c2c6ef"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vielhuber.de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":["Person","Organization"],"@id":"https:\/\/vielhuber.de\/#\/schema\/person\/64d4ff14713d413ea4d9b210d0c2c6ef","name":"David","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/vielhuber.de\/wp-content\/uploads\/about.jpg","url":"https:\/\/vielhuber.de\/wp-content\/uploads\/about.jpg","contentUrl":"https:\/\/vielhuber.de\/wp-content\/uploads\/about.jpg","width":700,"height":552,"caption":"David"},"logo":{"@id":"https:\/\/vielhuber.de\/wp-content\/uploads\/about.jpg"},"sameAs":["https:\/\/x.com\/vielhuber"]}]}},"_links":{"self":[{"href":"https:\/\/vielhuber.de\/hy\/wp-json\/wp\/v2\/posts\/913","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vielhuber.de\/hy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vielhuber.de\/hy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vielhuber.de\/hy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vielhuber.de\/hy\/wp-json\/wp\/v2\/comments?post=913"}],"version-history":[{"count":2,"href":"https:\/\/vielhuber.de\/hy\/wp-json\/wp\/v2\/posts\/913\/revisions"}],"predecessor-version":[{"id":1486,"href":"https:\/\/vielhuber.de\/hy\/wp-json\/wp\/v2\/posts\/913\/revisions\/1486"}],"wp:attachment":[{"href":"https:\/\/vielhuber.de\/hy\/wp-json\/wp\/v2\/media?parent=913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vielhuber.de\/hy\/wp-json\/wp\/v2\/categories?post=913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vielhuber.de\/hy\/wp-json\/wp\/v2\/tags?post=913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}