Same name in other branches
- 6.0.x src/Asset/JsOptimizer.php \Drupal\advagg\Asset\JsOptimizer::testForGoogleAnalytics()
- 8.x-3.x src/Asset/JsOptimizer.php \Drupal\advagg\Asset\JsOptimizer::testForGoogleAnalytics()
- 8.x-4.x src/Asset/JsOptimizer.php \Drupal\advagg\Asset\JsOptimizer::testForGoogleAnalytics()
Test if the provided path is from Google Analytics and add DNS entries.
Paramètres
string $path: The path to check.
Return value
array Empty array or an array to prefetch if file is from Google Analytics.
1 call to JsOptimizer::testForGoogleAnalytics()
- JsOptimizer::addDnsPrefetch dans src/
Asset/ JsOptimizer.php - Extract any domains to prefetch DNS.
Fichier
-
src/
Asset/ JsOptimizer.php, line 111
Classe
- JsOptimizer
- The JavaScript Optimizer.
Namespace
Drupal\advagg\AssetCode
private function testForGoogleAnalytics($path) {
$prefetch = [];
if (strpos($path, 'GoogleAnalytics') == FALSE && strpos($path, 'google-analytics') == FALSE) {
return $prefetch;
}
$prefetch[] = 'https://ssl.google-analytics.com';
$prefetch[] = 'https://stats.g.doubleclick.net';
return $prefetch;
}