diff --git a/lib/plausible_web/plugs/tracker.ex b/lib/plausible_web/plugs/tracker.ex index cd10a955f..4c5352cd4 100644 --- a/lib/plausible_web/plugs/tracker.ex +++ b/lib/plausible_web/plugs/tracker.ex @@ -10,7 +10,7 @@ defmodule PlausibleWeb.Tracker do "local", "manual", "file-downloads", - "dimensions", + "pageview-props", "tagged-events" ] diff --git a/lib/plausible_web/templates/layout/_tracking.html.eex b/lib/plausible_web/templates/layout/_tracking.html.eex index 401ba0225..309e28354 100644 --- a/lib/plausible_web/templates/layout/_tracking.html.eex +++ b/lib/plausible_web/templates/layout/_tracking.html.eex @@ -1,11 +1,11 @@ <%= if !Application.get_env(:plausible, :is_selfhost) && !@conn.assigns[:skip_plausible_tracking] do %> <%= if Application.get_env(:plausible, :environment) in ["prod", "staging"] do %> - + <% end %> <%= if Application.get_env(:plausible, :environment) == "dev" do %> - + <% end %> <% end %> diff --git a/tracker/compile.js b/tracker/compile.js index 125cc835a..31ff49711 100644 --- a/tracker/compile.js +++ b/tracker/compile.js @@ -26,7 +26,7 @@ function compilefile(input, output, templateVars = {}) { } } -const base_variants = ["hash", "outbound-links", "exclusions", "compat", "local", "manual", "file-downloads", "dimensions", "tagged-events"] +const base_variants = ["hash", "outbound-links", "exclusions", "compat", "local", "manual", "file-downloads", "pageview-props", "tagged-events"] const variants = [...g.clone.powerSet(base_variants)].filter(a => a.length > 0).map(a => a.sort()); compilefile(relPath('src/plausible.js'), relPath('../priv/tracker/js/plausible.js')) diff --git a/tracker/src/plausible.js b/tracker/src/plausible.js index 8a86cd75b..4a0645a67 100644 --- a/tracker/src/plausible.js +++ b/tracker/src/plausible.js @@ -77,14 +77,14 @@ payload.p = options.props } - {{#if dimensions}} - var dimensionAttributes = scriptEl.getAttributeNames().filter(function (name) { + {{#if pageview_props}} + var propAttributes = scriptEl.getAttributeNames().filter(function (name) { return name.substring(0, 6) === 'event-' }) var props = payload.p || {} - dimensionAttributes.forEach(function(attribute) { + propAttributes.forEach(function(attribute) { var propKey = attribute.replace('event-', '') var propValue = scriptEl.getAttribute(attribute) props[propKey] = props[propKey] || propValue