From 445b8c5d438cad1f0e79ad0dc0b4f0533fa8d175 Mon Sep 17 00:00:00 2001 From: Uku Taht Date: Wed, 23 Mar 2022 10:48:47 +0200 Subject: [PATCH] Show real view ID --- lib/plausible_web/controllers/site_controller.ex | 5 +++-- .../templates/site/import_from_google_confirm.html.eex | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/plausible_web/controllers/site_controller.ex b/lib/plausible_web/controllers/site_controller.ex index cb9052325..b5dfe7309 100644 --- a/lib/plausible_web/controllers/site_controller.ex +++ b/lib/plausible_web/controllers/site_controller.ex @@ -663,14 +663,15 @@ defmodule PlausibleWeb.SiteController do # TODO: Plausible.Google.Api.get_analytics_start_date(access_token) start_date = {:ok, ~D[2019-01-02]} end_date = Plausible.Stats.Clickhouse.pageview_start_date_local(site) + {:ok, view_ids} = Plausible.Google.Api.get_analytics_view_ids(access_token) conn |> assign(:skip_plausible_tracking, true) |> render("import_from_google_confirm.html", access_token: access_token, site: site, - # TODO: Also send the name here - view_id: view_id, + view_ids: view_ids, + selected_view_id: view_id, start_date: start_date, end_date: end_date, layout: {PlausibleWeb.LayoutView, "focus.html"} diff --git a/lib/plausible_web/templates/site/import_from_google_confirm.html.eex b/lib/plausible_web/templates/site/import_from_google_confirm.html.eex index 2298054b5..422feb184 100644 --- a/lib/plausible_web/templates/site/import_from_google_confirm.html.eex +++ b/lib/plausible_web/templates/site/import_from_google_confirm.html.eex @@ -7,16 +7,15 @@ <% {:ok, start_date} -> %>
- Choose the view in your Google Analytics account that will be imported to the <%= @site.domain %> dashboard. + Choose the view in your Google Analytics account that will be imported to the <%= @site.domain %> dashboard
<%= label f, :view_id, "Google Analytics view", class: "block text-sm font-medium text-gray-700" %> - <%= text_input f, :view_id, value: @view_id, readonly: "true", class: "mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md" %> + <%= select f, :view_id, @view_ids, readonly: "true", selected: @selected_view_id, class: "mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md" %>
- We will import historical data from your first Google Analytics visitor to your first Plausible visitor. If you'd - like to import data for a different time period, please contact support. + Import historical data from your first Google Analytics visitor to your first Plausible visitor