diff --git a/google_tag.install b/google_tag.install
index 9467abe..3ce1c79 100644
--- a/google_tag.install
+++ b/google_tag.install
@@ -27,10 +27,10 @@ function google_tag_requirements($phase) {
   if ($phase == 'runtime' || $phase == 'update' || $phase == 'install') {
     // Adapted from system_requirements().
     $directory = 'public://google_tag';
-    if (!is_dir($directory) || !is_writable($directory)) {
+    if (!is_dir($directory) || !_google_tag_file_directory_is_writable($directory)) {
       file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
     }
-    $is_writable = is_writable($directory);
+    $is_writable = _google_tag_file_directory_is_writable($directory);
     $is_directory = is_dir($directory);
     if (!$is_writable || !$is_directory) {
       // The snippet directory does not exist or is not writable.
diff --git a/google_tag.module b/google_tag.module
index afcba66..0a8e7ee 100644
--- a/google_tag.module
+++ b/google_tag.module
@@ -299,3 +299,24 @@ function _google_tag_role_check() {
   }
   return $satisfied;
 }
+
+/**
+ * Determines if a file or directory is executable.
+ *
+ * PHP's is_executable() does not fully support stream wrappers, so this
+ * function fills that gap.
+ * Based on core issue https://www.drupal.org/project/drupal/issues/944582.
+ *
+ * @param $uri
+ *   A URI or pathname pointing to the file or directory that will be checked.
+ *
+ * @return
+ *   TRUE if the file or directory is executable; FALSE otherwise.
+ *
+ * @see is_executable()
+ * @ingroup php_wrappers
+ */
+function _google_tag_file_directory_is_writable($uri) {
+  $realpath = drupal_realpath($uri);
+  return is_writable($realpath) && is_executable($realpath);
+}
diff --git a/src/Form/GoogleTagSettingsForm.php b/src/Form/GoogleTagSettingsForm.php
index 4979226..d102429 100644
--- a/src/Form/GoogleTagSettingsForm.php
+++ b/src/Form/GoogleTagSettingsForm.php
@@ -350,7 +350,7 @@ class GoogleTagSettingsForm extends ConfigFormBase {
   public function createAssets() {
     $result = TRUE;
     $directory = 'public://google_tag';
-    if (!is_dir($directory) || !is_writable($directory)) {
+    if (!is_dir($directory) || !_google_tag_file_directory_is_writable($directory)) {
       $result = file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
     }
     if ($result) {
