diff --git a/CHANGELOG.md b/CHANGELOG.md
index e575e36d6..680196652 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,7 +4,6 @@ All notable changes to this project will be documented in this file.
## Unreleased
### Added
-- Call to action for tracking Goal Conversions and an option to hide the section from the dashboard
- Add support for `with_imported=true` in Stats API aggregate endpoint
- Ability to use '--' instead of '=' sign in the `tagged-events` classnames
- 'Last updated X seconds ago' info to 'current visitors' tooltips
diff --git a/assets/js/dashboard/api.js b/assets/js/dashboard/api.js
index 158f9a60f..165ca0838 100644
--- a/assets/js/dashboard/api.js
+++ b/assets/js/dashboard/api.js
@@ -71,11 +71,3 @@ export function get(url, query={}, ...extraQuery) {
return response.json()
})
}
-
-export function put(url, body) {
- return fetch(url, {
- method: "PUT",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify(body)
- })
-}
diff --git a/assets/js/dashboard/components/notice.js b/assets/js/dashboard/components/notice.js
deleted file mode 100644
index fd2d9876a..000000000
--- a/assets/js/dashboard/components/notice.js
+++ /dev/null
@@ -1,56 +0,0 @@
-import React from "react"
-import { sectionTitles } from "../stats/behaviours"
-import * as api from '../api'
-
-export function FeatureSetupNotice({ site, feature, shortFeatureName, title, info, settingsLink, onHideAction }) {
- const sectionTitle = sectionTitles[feature]
-
- const requestHideSection = () => {
- if (window.confirm(`Are you sure you want to hide ${sectionTitle}? You can make it visible again in your site settings later.`)) {
- api.put(`/api/${encodeURIComponent(site.domain)}/disable-feature`, { feature: feature })
- .then(response => {
- if (response.ok) { onHideAction() }
- })
- }
- }
-
- function setupButton() {
- return (
-
-
- )
-}
\ No newline at end of file
diff --git a/assets/js/dashboard/historical.js b/assets/js/dashboard/historical.js
index 8f6dcdb90..524bcbab5 100644
--- a/assets/js/dashboard/historical.js
+++ b/assets/js/dashboard/historical.js
@@ -9,13 +9,25 @@ import Sources from './stats/sources'
import Pages from './stats/pages'
import Locations from './stats/locations';
import Devices from './stats/devices'
-import Behaviours from './stats/behaviours'
+import Conversions from './stats/conversions'
import ComparisonInput from './comparison-input'
import { withPinnedHeader } from './pinned-header-hoc';
function Historical(props) {
const tooltipBoundary = React.useRef(null)
+ function renderConversions() {
+ if (props.site.hasGoals) {
+ return (
+
+
+
+ )
+ }
+
+ return null
+ }
+
return (
@@ -39,7 +51,7 @@ function Historical(props) {
-
+ { renderConversions() }
)
}
diff --git a/assets/js/dashboard/mount.js b/assets/js/dashboard/mount.js
index 2f867b563..9c923a88b 100644
--- a/assets/js/dashboard/mount.js
+++ b/assets/js/dashboard/mount.js
@@ -16,10 +16,6 @@ if (container) {
domain: container.dataset.domain,
offset: container.dataset.offset,
hasGoals: container.dataset.hasGoals === 'true',
- conversionsEnabled: container.dataset.conversionsEnabled === 'true',
- funnelsEnabled: container.dataset.funnelsEnabled === 'true',
- propsEnabled: container.dataset.propsEnabled === 'true',
- funnels: JSON.parse(container.dataset.funnels),
statsBegin: container.dataset.statsBegin,
nativeStatsBegin: container.dataset.nativeStatsBegin,
embedded: container.dataset.embedded,
diff --git a/assets/js/dashboard/realtime.js b/assets/js/dashboard/realtime.js
index ea1a283ef..1c85f8b8c 100644
--- a/assets/js/dashboard/realtime.js
+++ b/assets/js/dashboard/realtime.js
@@ -8,10 +8,22 @@ import Sources from './stats/sources'
import Pages from './stats/pages'
import Locations from './stats/locations'
import Devices from './stats/devices'
-import Behaviours from './stats/behaviours'
+import Conversions from './stats/conversions'
import { withPinnedHeader } from './pinned-header-hoc';
class Realtime extends React.Component {
+ renderConversions() {
+ if (this.props.site.hasGoals) {
+ return (
+
- )
- }
}
diff --git a/assets/js/dashboard/stats/behaviours/prop-breakdown.js b/assets/js/dashboard/stats/conversions/prop-breakdown.js
similarity index 100%
rename from assets/js/dashboard/stats/behaviours/prop-breakdown.js
rename to assets/js/dashboard/stats/conversions/prop-breakdown.js
diff --git a/lib/plausible/site.ex b/lib/plausible/site.ex
index d51d7e19d..513a20fd8 100644
--- a/lib/plausible/site.ex
+++ b/lib/plausible/site.ex
@@ -18,9 +18,6 @@ defmodule Plausible.Site do
field :stats_start_date, :date
field :native_stats_start_at, :naive_datetime
field :allowed_event_props, {:array, :string}
- field :conversions_enabled, :boolean
- field :props_enabled, :boolean
- field :funnels_enabled, :boolean
field :ingest_rate_limit_scale_seconds, :integer, default: 60
# default is set via changeset/2
@@ -169,14 +166,6 @@ defmodule Plausible.Site do
change(site, allowed_event_props: list)
end
- def disable_feature(site, "conversions"), do: change(site, conversions_enabled: false)
- def disable_feature(site, "funnels"), do: change(site, funnels_enabled: false)
- def disable_feature(site, "props"), do: change(site, props_enabled: false)
-
- def enable_feature(site, "conversions"), do: change(site, conversions_enabled: true)
- def enable_feature(site, "funnels"), do: change(site, funnels_enabled: true)
- def enable_feature(site, "props"), do: change(site, props_enabled: true)
-
def remove_imported_data(site) do
change(site, imported_data: nil)
end
diff --git a/lib/plausible_web/controllers/api/internal_controller.ex b/lib/plausible_web/controllers/api/internal_controller.ex
index 751fcb6fc..40ea59b92 100644
--- a/lib/plausible_web/controllers/api/internal_controller.ex
+++ b/lib/plausible_web/controllers/api/internal_controller.ex
@@ -2,11 +2,9 @@ defmodule PlausibleWeb.Api.InternalController do
use PlausibleWeb, :controller
use Plausible.Repo
alias Plausible.Stats.Clickhouse, as: Stats
- alias Plausible.{Sites, Site, Auth}
- alias Plausible.Auth.User
def domain_status(conn, %{"domain" => domain}) do
- site = Sites.get_by_domain(domain)
+ site = Plausible.Sites.get_by_domain(domain)
if Stats.has_pageviews?(site) do
json(conn, "READY")
@@ -32,28 +30,11 @@ defmodule PlausibleWeb.Api.InternalController do
end
end
- def disable_feature(conn, %{"domain" => domain, "feature" => feature}) do
- with %User{id: user_id} <- conn.assigns[:current_user],
- site <- Sites.get_by_domain(domain),
- true <- Sites.has_admin_access?(user_id, site) || Auth.is_super_admin?(user_id) do
- Site.disable_feature(site, feature)
- |> Repo.update()
-
- json(conn, "ok")
- else
- _ ->
- PlausibleWeb.Api.Helpers.unauthorized(
- conn,
- "You need to be logged in as the owner or admin account of this site"
- )
- end
- end
-
defp sites_for(user, params) do
Repo.paginate(
from(
- s in Site,
- join: sm in Site.Membership,
+ s in Plausible.Site,
+ join: sm in Plausible.Site.Membership,
on: sm.site_id == s.id,
where: sm.user_id == ^user.id,
order_by: s.domain
diff --git a/lib/plausible_web/controllers/site_controller.ex b/lib/plausible_web/controllers/site_controller.ex
index 2ee92f949..6de9010ec 100644
--- a/lib/plausible_web/controllers/site_controller.ex
+++ b/lib/plausible_web/controllers/site_controller.ex
@@ -171,34 +171,6 @@ defmodule PlausibleWeb.SiteController do
end
end
- def set_feature_status(conn, %{"action" => action, "feature" => feature}) do
- site = conn.assigns[:site]
-
- report_title =
- case feature do
- "conversions" -> "Goals"
- "funnels" -> "Funnels"
- "props" -> "Properties"
- end
-
- {change, flash_msg} =
- case action do
- "enable" ->
- {Plausible.Site.enable_feature(site, feature),
- "#{report_title} are now visible again on your dashboard"}
-
- "disable" ->
- {Plausible.Site.disable_feature(site, feature),
- "#{report_title} are now hidden from your dashboard"}
- end
-
- Repo.update(change)
-
- conn
- |> put_flash(:success, flash_msg)
- |> redirect(to: Routes.site_path(conn, :settings_goals, conn.assigns[:site].domain))
- end
-
def settings(conn, %{"website" => website}) do
redirect(conn, to: Routes.site_path(conn, :settings_general, website))
end
diff --git a/lib/plausible_web/controllers/stats_controller.ex b/lib/plausible_web/controllers/stats_controller.ex
index b32d8c8d3..ad93738fb 100644
--- a/lib/plausible_web/controllers/stats_controller.ex
+++ b/lib/plausible_web/controllers/stats_controller.ex
@@ -64,7 +64,6 @@ defmodule PlausibleWeb.StatsController do
|> render("stats.html",
site: site,
has_goals: Plausible.Sites.has_goals?(site),
- funnels: [],
stats_start_date: stats_start_date,
native_stats_start_date: NaiveDateTime.to_date(site.native_stats_start_at),
title: "Plausible · " <> site.domain,
@@ -292,7 +291,6 @@ defmodule PlausibleWeb.StatsController do
|> render("stats.html",
site: shared_link.site,
has_goals: Sites.has_goals?(shared_link.site),
- funnels: [],
stats_start_date: shared_link.site.stats_start_date,
native_stats_start_date: NaiveDateTime.to_date(shared_link.site.native_stats_start_at),
title: "Plausible · " <> shared_link.site.domain,
@@ -326,11 +324,8 @@ defmodule PlausibleWeb.StatsController do
defp shared_link_cookie_name(slug), do: "shared-link-" <> slug
- defp get_flags(user) do
- %{
- funnels: FunWithFlags.enabled?(:funnels, for: user),
- props: FunWithFlags.enabled?(:props, for: user)
- }
+ defp get_flags(_user) do
+ %{}
end
defp is_dbip() do
diff --git a/lib/plausible_web/router.ex b/lib/plausible_web/router.ex
index 7ef5d2352..cd93e5fde 100644
--- a/lib/plausible_web/router.ex
+++ b/lib/plausible_web/router.ex
@@ -117,8 +117,6 @@ defmodule PlausibleWeb.Router do
post "/paddle/webhook", Api.PaddleController, :webhook
get "/:domain/status", Api.InternalController, :domain_status
- put "/:domain/disable-feature", Api.InternalController, :disable_feature
-
get "/sites", Api.InternalController, :sites
end
@@ -253,7 +251,6 @@ defmodule PlausibleWeb.Router do
get "/:website/goals/new", SiteController, :new_goal
post "/:website/goals", SiteController, :create_goal
delete "/:website/goals/:id", SiteController, :delete_goal
- put "/:website/settings/features/:action/:feature", SiteController, :set_feature_status
put "/:website/settings", SiteController, :update_settings
put "/:website/settings/google", SiteController, :update_google_auth
delete "/:website/settings/google-search", SiteController, :delete_google_auth
diff --git a/lib/plausible_web/templates/site/new_goal.html.eex b/lib/plausible_web/templates/site/new_goal.html.eex
index 0dae3ce57..0417c5a30 100644
--- a/lib/plausible_web/templates/site/new_goal.html.eex
+++ b/lib/plausible_web/templates/site/new_goal.html.eex
@@ -7,11 +7,6 @@
-
- Custom events are not tracked by default - you have to configure them on your site to be sent to Plausible. See examples and learn more in
- our docs.
-