docker/r10k/docker-entrypoint.d/10-analytics.sh in r10k-3.1.1 vs docker/r10k/docker-entrypoint.d/10-analytics.sh in r10k-3.2.0
- old
+ new
@@ -1,9 +1,9 @@
#!/bin/sh
-if [ "${PUPPERWARE_DISABLE_ANALYTICS}" = "true" ]; then
- echo "($0) Pupperware analytics disabled; skipping metric submission"
+if [ "${PUPPERWARE_ANALYTICS_ENABLED}" != "true" ]; then
+ # Don't print out any messages here since this is a CLI container
exit 0
fi
# See: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters
# Tracking ID
@@ -17,12 +17,14 @@
cid=$(cat $_file 2>/dev/null || (cat /proc/sys/kernel/random/uuid | tee $_file))
# Event Category
ec=${PUPPERWARE_ANALYTICS_STREAM:-dev}
# Event Action
ea=start
+# Anonymize ip
+aip=1
-_params="v=1&t=event&tid=${tid}&an=${an}&av=${av}&cid=${cid}&ec=${ec}&ea=${ea}"
+_params="v=1&t=event&tid=${tid}&an=${an}&av=${av}&cid=${cid}&ec=${ec}&ea=${ea}&aip=${aip}"
_url="http://www.google-analytics.com/collect?${_params}"
-echo "($0) Sending metrics ${_url}"
+# Don't print out any messages here since this is a CLI container
curl --fail --silent --show-error --output /dev/null \
-X POST -H "Content-Length: 0" $_url