Settings for <%= @site.domain %>

General

<%= form_for @changeset, "/#{URI.encode_www_form(@site.domain)}/settings", [class: "max-w-xs"], fn f -> %>
<%= label f, :domain, class: "block text-gray-700 text-sm font-bold mb-2" %> <%= text_input f, :domain, class: "transition bg-gray-200 appearance-none border border-transparent rounded w-full p-2 text-gray-700 leading-normal appearance-none focus:outline-none focus:border-gray-300 ", disabled: "disabled" %> <%= error_tag f, :domain %>
<%= label f, :timezone, "Reporting Timezone", class: "block text-gray-700 text-sm font-bold mb-2" %>
<%= select f, :timezone, Plausible.Timezones.options(), class: "block appearance-none w-full bg-gray-200 text-gray-700 cursor-pointer hover:border-gray-500 p-2 pr-8 rounded leading-normal focus:outline-none" %>
<%= submit "Save changes", class: "button mt-4" %> <% end %>

Visibility

<%= if @site.public do %> Stats for <%= @site.domain %> are currently public. Anyone with the following link can view the stats:
<%= button("Make stats private", to: "/sites/#{URI.encode_www_form(@site.domain)}/make-private", method: "POST", class: "button mt-8") %> <% else %>
Stats for <%= @site.domain %> are currently private. You are the only person who can see them. If you choose to make your stats public, anyone with the link will be able to view them.
<%= button("Make stats public", to: "/sites/#{URI.encode_www_form(@site.domain)}/make-public", method: "POST", class: "button mt-8") %> <% end %>

Shared links

You can share your stats privately by generating a shared link. The links are impossible to guess and you can add password protection for extra security.
<%= for link <- @shared_links do %>
<%= button(to: "/sites/#{URI.encode_www_form(@site.domain)}/shared-links/#{link.slug}", method: :delete, class: "py-2 px-4 bg-gray-200 text-red-600 rounded-l-none", data: [confirm: "Are you sure you want to delete this shared link? The stats will not be accessible with this link anymore."]) do %> <% end %>
<% end %>
<%= link("+ New link", to: "/sites/#{URI.encode_www_form(@site.domain)}/shared-links/new", class: "button mt-4") %>

Goals

<%= if Enum.count(@goals) > 0 do %> <%= for goal <- @goals do %>
<%= goal_name(goal) %> <%= button("❌", to: "/#{URI.encode_www_form(@site.domain)}/goals/#{goal.id}", method: :delete, class: "text-sm", data: [confirm: "Are you sure you want to remove goal #{goal_name(goal)}? This will just affect the UI, all of your analytics data will stay intact."]) %>
<% end %> <% else %>
No goals configured for this site yet
<% end %>
<%= link("+ Add goal", to: "/#{URI.encode_www_form(@site.domain)}/goals/new", class: "button mt-6") %>

Google Integration

Integrating with your Google account allows Plausible to show more information about your websites' performance on their search engine.
<%= if @site.google_auth do %>
Connected Google account: <%= @site.google_auth.email %> <%= if @site.google_auth.property && !(@site.google_auth.property in @search_console_domains) do %>

NB: Your Google account does not have access to your currently configured property, <%= @site.google_auth.property %>. Please select a verified property from the list below.

<% else %>

Select the Google Search Console property you would like to pull keyword data from. If you don't see your domain, <%= link("set it up and verify", to: "https://docs.plausible.io/google-search-console-integration#1-add-your-site-on-the-search-console", class: "text-indigo-500") %> on Search Console first.

<% end %> <%= form_for Plausible.Site.GoogleAuth.changeset(@site.google_auth), "/#{URI.encode_www_form(@site.domain)}/settings/google", [class: "max-w-xs"], fn f -> %>
<%= select f, :property, @search_console_domains, prompt: "(Choose property)", class: "block appearance-none w-full bg-gray-200 text-gray-700 cursor-pointer hover:border-gray-500 p-2 pr-8 rounded leading-normal focus:outline-none" %>
<%= submit "Save", class: "button" %> <% end %> <% else %> <%= button("Continue with Google", to: Plausible.Google.Api.authorize_url(@site.id), class: "button mt-4") %>
NB: You also need to set up your site on <%= link("Google Search Console", to: "https://search.google.com/search-console/about") %> for the integration to work. <%= link("Read the docs", to: "https://docs.plausible.io/google-search-console-integration", class: "text-indigo-500") %>
<% end %>

Email reports

<%= if @weekly_report do %> <%= button(to: "/sites/#{URI.encode_www_form(@site.domain)}/weekly-report/disable", method: :post, class: "border rounded-full border-gray-300 flex items-center cursor-pointer w-8 bg-green-500 justify-end") do %> <% end %> <% else %> <%= button(to: "/sites/#{URI.encode_www_form(@site.domain)}/weekly-report/enable", method: :post, class: "border rounded-full border-gray-300 flex items-center cursor-pointer w-8 justify-start") do %> <% end %> <% end %> Send a weekly email report every Monday
<%= if @weekly_report do %>

Weekly report recipients

<%= for recipient <- @weekly_report.recipients do %>
<%= recipient %> <%= button("❌", to: "/sites/#{URI.encode_www_form(@site.domain)}/weekly-report/recipients/#{recipient}", method: :delete) %>
<% end %> <%= form_for @conn, "/sites/#{URI.encode_www_form(@site.domain)}/weekly-report/recipients", fn f -> %>
<%= email_input f, :recipient, class: "transition bg-gray-200 appearance-none border border-transparent rounded w-full p-2 text-gray-700 leading-normal appearance-none focus:outline-none focus:border-gray-300", style: "flex-grow: 2", placeholder: "recipient@example.com" %> <%= submit "Add recipient", class: "button rounded-l-none whitespace-no-wrap" %>
<% end %>
<% end %>
<%= if @monthly_report do %> <%= button(to: "/sites/#{URI.encode_www_form(@site.domain)}/monthly-report/disable", method: :post, class: "border rounded-full border-gray-300 flex items-center cursor-pointer w-8 bg-green-500 justify-end") do %> <% end %> <% else %> <%= button(to: "/sites/#{URI.encode_www_form(@site.domain)}/monthly-report/enable", method: :post, class: "border rounded-full border-gray-300 flex items-center cursor-pointer w-8 justify-start") do %> <% end %> <% end %> Send a monthly email report on 1st of the month
<%= if @monthly_report do %>

Monthly report recipients

<%= for recipient <- @monthly_report.recipients do %>
<%= recipient %> <%= button("❌", to: "/sites/#{URI.encode_www_form(@site.domain)}/monthly-report/recipients/#{recipient}", method: :delete) %>
<% end %> <%= form_for @conn, "/sites/#{URI.encode_www_form(@site.domain)}/monthly-report/recipients", fn f -> %>
<%= email_input f, :recipient, class: "transition bg-gray-200 appearance-none border border-transparent rounded w-full p-2 text-gray-700 leading-normal appearance-none focus:outline-none focus:border-gray-300", style: "flex-grow: 2", placeholder: "recipient@example.com" %> <%= submit "Add recipient", class: "button rounded-l-none whitespace-no-wrap" %>
<% end %>
<% end %>

Custom domain

Some browsers and extensions block all analytics services, including privacy-friendly ones like Plausible.

To get around that, we offer a quick and easy way to serve the script from your custom domain. As a result, your stats are never blocked by clients because they are proxied through your subdomain.
<%= if @site.custom_domain do %> Configured domain: <%= @site.custom_domain.domain %> <% else %> <%= link("Add custom domain", to: "/sites/#{URI.encode_www_form(@site.domain)}/custom-domains/new", class: "button") %> <% end %>
<%= form_for @conn, "/", [class: "bg-white max-w-xl mx-auto shadow-md rounded rounded-t-none border-t-2 border-indigo-100 px-8 pt-6 pb-8 mb-4 mt-16"], fn f -> %>

Javascript snippet

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

<%= textarea f, :domain, id: "snippet_code", class: "transition overflow-hidden bg-gray-200 appearance-none border border-transparent rounded w-full p-2 pr-6 text-gray-700 leading-normal appearance-none focus:outline-none focus:bg-white focus:border-gray-300 text-xs mt-2 resize-none", value: snippet(@site), rows: 2 %>
<% end %>

Delete site data

Deleting the site removes all stats you've collected

<%= link "Delete #{@site.domain}", to: "/#{URI.encode_www_form(@site.domain)}", method: :delete, class: "button bg-red-600 mt-6", data: [confirm: "Deleting the site data cannot be reversed. Are you sure?"] %>