diff --git a/src/MetatagManager.php b/src/MetatagManager.php
index 9123713..8d08db3 100644
--- a/src/MetatagManager.php
+++ b/src/MetatagManager.php
@@ -269,6 +269,14 @@ class MetatagManager implements MetatagManagerInterface {
     $metatag_tags = $this->tagPluginManager->getDefinitions();
     $elements = [];
 
+    // Order the elements by weight first, as some systems like facebook care.
+    uksort($tags, function ($tag_name_a, $tag_name_b) use ($metatag_tags) {
+      $weight_a = isset($metatag_tags[$tag_name_a]['weight']) ? $metatag_tags[$tag_name_a]['weight'] : 0;
+      $weight_b = isset($metatag_tags[$tag_name_b]['weight']) ? $metatag_tags[$tag_name_b]['weight'] : 0;
+
+      return  ($weight_a < $weight_b) ? -1 : 1;
+    });
+
     // Each element of the $values array is a tag with the tag plugin name
     // as the key.
     foreach ($tags as $tag_name => $value) {
diff --git a/tests/src/Kernel/MetatagManagerTest.php b/tests/src/Kernel/MetatagManagerTest.php
new file mode 100644
index 0000000..e5b0652
--- /dev/null
+++ b/tests/src/Kernel/MetatagManagerTest.php
@@ -0,0 +1,66 @@
+<?php
+
+namespace Drupal\Tests\metatag\Kernel;
+
+use Drupal\KernelTests\KernelTestBase;
+
+/**
+ * Tests the metatag manager.
+ *
+ * @group metatag
+ */
+class MetatagManagerTest extends KernelTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['metatag', 'metatag_open_graph'];
+
+  public function testMetatagOrder() {
+    /** @var \Drupal\metatag\MetatagManager $metatag_manager */
+    $metatag_manager = \Drupal::service('metatag.manager');
+
+    $tags = $metatag_manager->generateElements([
+      'og_image_width' => 100,
+      'og_image_height' => 100,
+      'og_image_url' => 'http://giraffe.com/example/foo.png',
+    ]);
+
+    $expected = [
+      '#attached' => ['html_head' => [
+        [
+          [
+            '#tag'=> 'meta',
+            '#attributes' => [
+              'property' => 'og:image:url',
+              'content' => 'http://giraffe.com/example/foo.png',
+            ],
+          ],
+          'og_image_url',
+        ],
+        [
+          [
+            '#tag'=> 'meta',
+            '#attributes' => [
+              'property' => 'og:image:width',
+              'content' => 100,
+            ],
+          ],
+          'og_image_width',
+        ],
+        [
+          [
+            '#tag'=> 'meta',
+            '#attributes' => [
+              'property' => 'og:image:height',
+              'content' => 100,
+            ],
+          ],
+          'og_image_height',
+        ],
+      ]],
+    ];
+    $this->assertEquals($expected, $tags);
+  }
+
+}
