diff --git a/configure.ac b/configure.ac
index 361bd2a..197035e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,6 +21,8 @@ PKG_PROG_PKG_CONFIG([0.22])
 
 GLIB_GSETTINGS
 
+AC_ARG_VAR(GIT_VERSION, git-version to be placed in metadata.json, will be overwritten when uploaded to gnome.org (default not set))
+
 AC_ARG_WITH(desktop-dir, [  --with-desktop-dir=PATH where to install desktop files (default=PREFIX/share)])
 
 if test "x$with_desktop_dir" != x; then
diff --git a/data/Makefile.am b/data/Makefile.am
index 2d1cfff..4ff0916 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -16,7 +16,8 @@ EXTRA_DIST = metadata.json.in
 metadata.json: metadata.json.in $(top_builddir)/config.status
 	$(AM_V_GEN) sed -e "s|[@]LOCALEDIR@|$(datadir)/locale|" \
 	    -e "s|[@]uuid@|$(uuid)|" \
-	    -e "s|[@]url@|$(extensionurl)|" $< > $@
+	    -e "s|[@]url@|$(extensionurl)|" \
+	    -e "s|[@]version@|$(GIT_VERSION)|" $< > $@
 
 CLEANFILES = metadata.json
 
diff --git a/data/metadata.json.in b/data/metadata.json.in
index 2aceb1c..505a056 100644
--- a/data/metadata.json.in
+++ b/data/metadata.json.in
@@ -4,5 +4,6 @@
 "description": "Weather extension to display weather information from https://openweathermap.org/ or https://forecast.io for almost all locations in the world.\nTo use the weather-data of forecast.io, you have to register on their site (https://developer.forecast.io/register) and get a personal API-key.\n\nSince version 29 this extensions uses coordinates to store the locations and makes the names editable to support multiple weather-providers!\nIf you update from versions prior to 29 to 29 or greater (with forecast.io - support) you have to recreate your locations.",
 "shell-version": [ "3.12", "3.14", "3.16", "3.17.4", "3.17.90" ],
 "localedir": "@LOCALEDIR@",
-"url": "@url@"
+"url": "@url@",
+"version": "@version@"
 }