<%= form_for @changeset, "/#{URI.encode_www_form(@site.domain)}/settings", fn f -> %>

General information

Update your reporting timezone.

<%= link(to: "https://plausible.io/docs/general/", target: "_blank", rel: "noreferrer") do %> <% end %>
<%= label f, :domain, class: "block text-sm font-medium leading-5 text-gray-700 dark:text-gray-300" %> <%= text_input f, :domain, class: "dark:bg-gray-900 mt-1 block w-full shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:max-w-xs sm:text-sm border-gray-300 dark:border-gray-500 rounded-md dark:text-gray-100", disabled: "disabled" %>
<%= label f, :timezone, "Reporting Timezone", class: "block text-sm font-medium leading-5 text-gray-700 dark:text-gray-300" %> <%= select f, :timezone, Plausible.Timezones.options(), class: "dark:bg-gray-900 mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 dark:border-gray-500 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md dark:text-gray-100 cursor-pointer" %>
<%= submit "Save", class: "button" %>
<% end %> <%= form_for @conn, "/", [class: "shadow bg-white dark:bg-gray-800 sm:rounded-md sm:overflow-hidden py-6 px-4 sm:p-6"], fn f -> %>

Javascript snippet

Include this snippet in the <head> of your website.

<%= link(to: "https://plausible.io/docs/plausible-script", target: "_blank", rel: "noreferrer") do %> <% end %>
<%= textarea f, :domain, id: "snippet_code", class: "transition overflow-hidden bg-gray-100 dark:bg-gray-900 outline-none appearance-none border border-transparent rounded w-full p-2 pr-6 text-gray-700 dark:text-gray-300 leading-normal focus:outline-none focus:bg-white focus:border-gray-300 dark:focus:border-gray-500 text-xs mt-2 resize-none", value: snippet(@site), rows: 2 %>
<% end %>

Data Import from Google Analytics

Import existing data from your Google Analytics account.

<%= link(to: "https://docs.plausible.io/import-data/", target: "_blank", rel: "noreferrer") do %> <% end %>
<%= if Keyword.get(Application.get_env(:plausible, :google), :client_id) do %> <%= cond do %> <% @site.imported_data && @site.imported_data.status == "importing" -> %>
We are importing data from <%= @site.imported_data.source %> in the background... You will receive an email when it's completed
<% @site.imported_data && @site.imported_data.status == "ok" -> %>
  • Forget Imported Data

    Removes all data imported from <%= @site.imported_data.source %>

    <%= link("Forget imported stats", to: "/#{URI.encode_www_form(@site.domain)}/settings/forget-imported", method: :delete, class: "inline-block mt-4 px-4 py-2 border border-gray-300 dark:border-gray-500 text-sm leading-5 font-medium rounded-md text-red-700 bg-white dark:bg-gray-800 hover:text-red-500 dark:hover:text-red-400 focus:outline-none focus:border-blue-300 focus:ring active:text-red-800 active:bg-gray-50 transition ease-in-out duration-150") %>
  • <% @site.imported_data && @site.imported_data.status == "error" -> %>
    Your latest import has failed. You can try importing again by clicking the button below. If you try multiple times and the import keeps failing, please contact support.
    <%= button(to: Plausible.Google.Api.authorize_url(@site.id, "import"), class: "inline-flex pr-4 items-center border border-gray-100 shadow rounded-md focus:outline-none focus:ring-1 focus:ring-offset-1 focus:ring-gray-200 mt-8 hover:bg-gray-50") do %> <%= google_logo() %> Continue with Google <% end %>
    <% true -> %>
    <%= button(to: Plausible.Google.Api.authorize_url(@site.id, "import"), class: "inline-flex pr-4 items-center border border-gray-100 shadow rounded-md focus:outline-none focus:ring-1 focus:ring-offset-1 focus:ring-gray-200 mt-8 hover:bg-gray-50") do %> <%= google_logo() %> Continue with Google <% end %>
    <% end %> <% else %>

    An extra step is needed to set up your Plausible Analytics Self Hosted for the Google Search Console integration. Find instructions <%= link("here", to: "https://plausible.io/docs/self-hosting-configuration#google-search-integration", class: "text-indigo-500") %>

    <% end %>