Show real view ID

pull/1749/head
Uku Taht 5 years ago
parent 203f87520b
commit 445b8c5d43

@ -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"}

@ -7,16 +7,15 @@
<% {:ok, start_date} -> %>
<div class="mt-6 text-sm text-gray-500">
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
</div>
<div class="mt-3">
<%= 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" %>
</div>
<div class="mt-6 text-sm text-gray-500">
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
</div>
<div class="flex justify-between mt-3">
<div class="w-36">

Loading…
Cancel
Save