2020-03-06 12:11:38 +03:00
< div class = " pt-12 " > < / div >
< div class = " max-w-xl mx-auto flex justify-between " >
< a href = " /<%= URI.encode_www_form(@site.domain) %> " > < h1 class = " text-2xl font-black " > Settings for < % = @site . domain % > < / h1 > < / a >
2019-09-02 14:29:19 +03:00
< / div >
2020-03-06 12:11:38 +03:00
< div class = " max-w-xl mx-auto bg-white shadow-md rounded rounded-t-none border-t-2 border-indigo-100 px-8 pt-6 pb-8 mt-6 " >
2019-09-02 14:29:19 +03:00
< div class = " flex items-center justify-between " >
2020-03-06 12:11:38 +03:00
< h2 class = " text-xl font-black " > General < / h2 >
2019-09-02 14:29:19 +03:00
< / div >
2020-03-06 12:11:38 +03:00
< div class = " my-4 border-b border-gray-200 " > < / div >
2019-09-02 14:29:19 +03:00
2020-02-04 16:44:13 +03:00
< % = form_for @changeset , " / #{ URI . encode_www_form ( @site . domain ) } /settings " , [ class : " max-w-xs " ] , fn f -> % >
2019-09-02 14:29:19 +03:00
< div class = " my-4 " >
2020-03-06 12:11:38 +03:00
< % = label f , :domain , class : " block text-gray-700 text-sm font-bold mb-2 " % >
2020-03-26 15:22:48 +03:00
< % = text_input f , :domain , class : " transition bg-gray-100 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 " % >
2019-09-02 14:29:19 +03:00
< % = error_tag f , :domain % >
< / div >
< div class = " my-4 " >
2020-03-06 12:11:38 +03:00
< % = label f , :timezone , " Reporting Timezone " , class : " block text-gray-700 text-sm font-bold mb-2 " % >
2019-09-02 14:29:19 +03:00
< div class = " inline-block relative w-full " >
2020-03-26 15:22:48 +03:00
< % = select f , :timezone , Plausible.Timezones . options ( ) , class : " block appearance-none w-full bg-gray-100 text-gray-700 cursor-pointer hover:border-gray-500 p-2 pr-8 rounded leading-normal focus:outline-none " % >
2020-03-06 12:11:38 +03:00
< div class = " pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-pink-500 " >
2019-09-02 14:29:19 +03:00
< svg class = " fill-current h-4 w-4 " xmlns = " http://www.w3.org/2000/svg " viewBox = " 0 0 20 20 " > < path d = " M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z " / > < / svg >
< / div >
< / div >
< / div >
< % = submit " Save changes " , class : " button mt-4 " % >
< % end % >
< / div >
2020-03-06 12:11:38 +03:00
< div class = " max-w-xl mx-auto bg-white shadow-md rounded rounded-t-none border-t-2 border-indigo-100 px-8 pt-6 pb-8 mt-10 " id = " visibility " >
< h2 class = " text-xl font-black " > Visibility < / h2 >
2019-09-02 14:29:19 +03:00
2020-03-06 12:11:38 +03:00
< div class = " my-4 border-b border-gray-300 " > < / div >
2019-09-02 14:29:19 +03:00
< % = if @site . public do % >
Stats for < % = @site . domain % > are currently < b > public < / b > . Anyone with the following link can view the stats :
2020-01-29 12:29:11 +03:00
< div class = " relative text-sm mt-4 " >
2020-03-26 15:22:48 +03:00
< input type = " text " id = " public-link " value = " https://plausible.io/<%= URI.encode_www_form(@site.domain) %> " class = " transition bg-gray-100 appearance-none border border-transparent rounded w-full p-2 pr-16 text-gray-700 appearance-none focus:outline-none " / >
2020-03-06 12:11:38 +03:00
< a onclick = " var input = document.getElementById('public-link'); input.focus(); input.select(); document.execCommand('copy'); " href = " javascript:void(0) " class = " absolute right-0 text-indigo-700 font-bold p-2 " >
2020-01-29 12:29:11 +03:00
< svg class = " feather-sm " > < use xlink :href = " # feather-copy " / > < / svg >
< / a >
< / div >
2020-02-04 16:44:13 +03:00
< % = button ( " Make stats private " , to : " /sites/ #{ URI . encode_www_form ( @site . domain ) } /make-private " , method : " POST " , class : " button mt-8 " ) % >
2019-09-02 14:29:19 +03:00
< % else % >
2020-03-06 12:11:38 +03:00
< div class = " text-gray-700 " >
2019-09-02 14:29:19 +03:00
Stats for < % = @site . domain % > are currently < b > private < / b > . 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 .
< / div >
2020-02-04 16:44:13 +03:00
< % = button ( " Make stats public " , to : " /sites/ #{ URI . encode_www_form ( @site . domain ) } /make-public " , method : " POST " , class : " button mt-8 " ) % >
2019-09-02 14:29:19 +03:00
< % end % >
2020-01-29 12:29:11 +03:00
2020-03-06 12:11:38 +03:00
< div class = " mt-12 " >
< h2 class = " text-xl font-black " > Shared links < / h2 >
2020-01-29 12:29:11 +03:00
2020-03-06 12:11:38 +03:00
< div class = " my-4 border-b border-gray-300 " > < / div >
2020-01-29 12:29:11 +03:00
< div class = " my-4 " >
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 .
< / div >
< % = for link <- @shared_links do % >
< div class = " flex relative w-full mt-2 text-sm " >
2020-03-26 15:22:48 +03:00
< input type = " text " id = " <%= link.slug %> " readonly = " readonly " value = " <%= shared_link_dest(link) %> " class = " transition bg-gray-100 appearance-none border border-transparent rounded rounded-r-none w-full p-2 text-gray-700 appearance-none focus:outline-none focus:border-gray-300 " / >
< button onclick = " var input = document.getElementById('<%= link.slug %>'); input.focus(); input.select(); document.execCommand('copy'); " href = " javascript:void(0) " class = " py-2 px-4 bg-gray-100 text-indigo-800 rounded-none border-r border-gray-300 " >
2020-01-29 12:29:11 +03:00
< svg class = " feather-sm " > < use xlink :href = " # feather-copy " / > < / svg >
< / button >
2020-03-26 15:22:48 +03:00
< % = button ( to : " /sites/ #{ URI . encode_www_form ( @site . domain ) } /shared-links/ #{ link . slug } " , method : :delete , class : " py-2 px-4 bg-gray-100 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 % >
2020-01-29 12:29:11 +03:00
< svg class = " feather-sm " > < use xlink :href = " # feather-trash-2 " / > < / svg >
< % end % >
< / div >
< % end % >
< / div >
2020-02-04 16:44:13 +03:00
< % = link ( " + New link " , to : " /sites/ #{ URI . encode_www_form ( @site . domain ) } /shared-links/new " , class : " button mt-4 " ) % >
2019-09-02 14:29:19 +03:00
< / div >
2020-03-06 12:11:38 +03:00
< div class = " max-w-xl mx-auto bg-white shadow-md rounded rounded-t-none border-t-2 border-indigo-100 px-8 pt-6 pb-8 mt-10 " >
< h2 class = " text-xl font-black " > Goals < / h2 >
< div class = " my-4 border-b border-gray-300 " > < / div >
2019-11-28 07:01:07 +03:00
< div >
< % = if Enum . count ( @goals ) > 0 do % >
< % = for goal <- @goals do % >
2020-03-06 12:11:38 +03:00
< div class = " border-b border-gray-300 py-3 flex justify-between " >
2019-11-28 07:01:07 +03:00
< small class = " font-bold " > < % = goal_name ( goal ) % > < / small >
2020-02-04 16:44:13 +03:00
< % = 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. " ] ) % >
2019-11-28 07:01:07 +03:00
< / div >
< % end % >
< % else % >
< div > No goals configured for this site yet < / div >
< % end % >
< / div >
2020-02-04 16:44:13 +03:00
< % = link ( " + Add goal " , to : " / #{ URI . encode_www_form ( @site . domain ) } /goals/new " , class : " button mt-6 " ) % >
2019-11-28 07:01:07 +03:00
< / div >
2020-03-06 12:11:38 +03:00
< div class = " max-w-xl mx-auto bg-white shadow-md rounded rounded-t-none border-t-2 border-indigo-100 px-8 pt-6 pb-8 mt-10 " id = " google-auth " >
< h2 class = " text-xl font-black " > Google Integration < / h2 >
2019-09-02 14:29:19 +03:00
2020-03-06 12:11:38 +03:00
< div class = " my-4 border-b border-gray-300 " > < / div >
< div class = " text-gray-700 my-4 " >
2019-09-02 14:29:19 +03:00
Integrating with your Google account allows Plausible to show more information about your websites ' performance on their search engine.
< / div >
< % = if @site . google_auth do % >
< div class = " py-2 " > < / div >
2020-03-06 12:11:38 +03:00
< span class = " text-gray-700 " > Connected Google account : < b > < % = @site . google_auth . email % > < / b > < / span >
2019-10-10 07:12:15 +03:00
< % = if @site . google_auth . property && ! ( @site . google_auth . property in @search_console_domains ) do % >
2020-03-06 12:11:38 +03:00
< p class = " text-gray-700 mt-6 font-bold " >
2019-10-10 07:12:15 +03:00
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 .
< / p >
2019-09-02 14:29:19 +03:00
< % else % >
2020-03-06 12:11:38 +03:00
< p class = " text-gray-700 mt-6 " >
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.
2019-10-10 07:12:15 +03:00
< / p >
< % end % >
2020-02-04 16:44:13 +03:00
< % = form_for Plausible.Site.GoogleAuth . changeset ( @site . google_auth ) , " / #{ URI . encode_www_form ( @site . domain ) } /settings/google " , [ class : " max-w-xs " ] , fn f -> % >
2019-10-10 07:12:15 +03:00
< div class = " my-6 " >
< div class = " inline-block relative w-full " >
2020-03-26 15:22:48 +03:00
< % = select f , :property , @search_console_domains , prompt : " (Choose property) " , class : " block appearance-none w-full bg-gray-100 text-gray-700 cursor-pointer hover:border-gray-500 p-2 pr-8 rounded leading-normal focus:outline-none " % >
2020-03-06 12:11:38 +03:00
< div class = " pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-pink-500 " >
2019-10-10 07:12:15 +03:00
< svg class = " fill-current h-4 w-4 " xmlns = " http://www.w3.org/2000/svg " viewBox = " 0 0 20 20 " > < path d = " M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z " / > < / svg >
< / div >
< / div >
2019-09-02 14:29:19 +03:00
< / div >
2019-10-10 07:12:15 +03:00
< % = submit " Save " , class : " button " % >
2019-09-02 14:29:19 +03:00
< % end % >
< % else % >
< % = button ( " Continue with Google " , to : Plausible.Google.Api . authorize_url ( @site . id ) , class : " button mt-4 " ) % >
2020-03-06 12:11:38 +03:00
< div class = " text-gray-700 mt-8 " >
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 " ) % >
2019-09-02 14:29:19 +03:00
< / div >
< % end % >
< / div >
2020-03-06 12:11:38 +03:00
< div class = " max-w-xl mx-auto bg-white shadow-md rounded rounded-t-none border-t-2 border-indigo-100 px-8 pt-6 pb-8 mt-10 " id = " email-reports " >
< h2 class = " text-xl font-black " > Email reports < / h2 >
2019-09-07 17:01:37 +03:00
2020-03-06 12:11:38 +03:00
< div class = " my-4 border-b border-gray-300 " > < / div >
2019-09-07 17:01:37 +03:00
2019-09-10 18:17:48 +03:00
< div class = " my-8 flex items-center " >
2020-01-22 12:16:53 +03:00
< % = if @weekly_report do % >
2020-03-06 12:11:38 +03:00
< % = 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 % >
< span class = " rounded-full border w-4 h-4 border-gray-300 shadow-inner bg-white shadow " > < / span >
2019-09-07 17:01:37 +03:00
< % end % >
< % else % >
2020-03-06 12:11:38 +03:00
< % = 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 % >
< span class = " rounded-full border w-4 h-4 border-gray-300 shadow-inner bg-white shadow " > < / span >
2019-09-07 17:01:37 +03:00
< % end % >
< % end % >
2020-01-22 12:16:53 +03:00
< span class = " ml-2 " > Send a weekly email report every Monday < / span >
2019-09-07 17:01:37 +03:00
< / div >
2020-01-22 12:16:53 +03:00
< % = if @weekly_report do % >
2020-03-06 12:11:38 +03:00
< div class = " text-sm text-gray-700 mt-6 " >
< h4 class = " font-bold my-2 " > Weekly report recipients < / h4 >
2020-01-22 12:16:53 +03:00
< % = for recipient <- @weekly_report . recipients do % >
2020-03-26 15:22:48 +03:00
< div class = " p-2 flex justify-between bg-gray-100 rounded my-2 max-w-md " >
2020-03-06 12:11:38 +03:00
< span > < svg class = " feather mr-1 " > < use xlink :href = " # feather-mail " / > < / svg > < % = recipient % > < / span >
2020-02-04 16:44:13 +03:00
< % = button ( " ❌ " , to : " /sites/ #{ URI . encode_www_form ( @site . domain ) } /weekly-report/recipients/ #{ recipient } " , method : :delete ) % >
2020-01-22 12:16:53 +03:00
< / div >
< % end % >
2020-02-04 16:44:13 +03:00
< % = form_for @conn , " /sites/ #{ URI . encode_www_form ( @site . domain ) } /weekly-report/recipients " , fn f -> % >
2020-03-06 12:11:38 +03:00
< div class = " flex justify-between my-2 max-w-md " >
2020-03-26 15:22:48 +03:00
< % = email_input f , :recipient , class : " transition bg-gray-100 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 " % >
2020-01-22 12:16:53 +03:00
< % = submit " Add recipient " , class : " button rounded-l-none whitespace-no-wrap " % >
2019-09-09 14:37:57 +03:00
< / div >
< % end % >
< / div >
< % end % >
2020-03-06 12:11:38 +03:00
< div class = " my-8 border-b border-gray-300 " > < / div >
2019-09-09 14:37:57 +03:00
< div class = " my-8 flex items-center " >
2020-01-22 12:16:53 +03:00
< % = if @monthly_report do % >
2020-03-06 12:11:38 +03:00
< % = 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 % >
< span class = " rounded-full border w-4 h-4 border-gray-300 shadow-inner bg-white shadow " > < / span >
2019-09-09 14:37:57 +03:00
< % end % >
< % else % >
2020-03-06 12:11:38 +03:00
< % = 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 % >
< span class = " rounded-full border w-4 h-4 border-gray-300 shadow-inner bg-white shadow " > < / span >
2019-09-09 14:37:57 +03:00
< % end % >
< % end % >
2020-01-22 12:16:53 +03:00
< span class = " ml-2 " > Send a monthly email report on 1 st of the month < / span >
2019-09-09 14:37:57 +03:00
< / div >
2020-01-22 12:16:53 +03:00
< % = if @monthly_report do % >
2020-03-06 12:11:38 +03:00
< div class = " text-sm text-gray-700 mt-6 " >
< h4 class = " font-bold my-2 " > Monthly report recipients < / h4 >
2020-01-22 12:16:53 +03:00
< % = for recipient <- @monthly_report . recipients do % >
2020-03-26 15:22:48 +03:00
< div class = " p-2 flex justify-between bg-gray-100 rounded my-2 max-w-md " >
2020-03-06 12:11:38 +03:00
< span > < svg class = " feather mr-1 " > < use xlink :href = " # feather-mail " / > < / svg > < % = recipient % > < / span >
2020-02-04 16:44:13 +03:00
< % = button ( " ❌ " , to : " /sites/ #{ URI . encode_www_form ( @site . domain ) } /monthly-report/recipients/ #{ recipient } " , method : :delete ) % >
2020-01-22 12:16:53 +03:00
< / div >
< % end % >
2020-02-04 16:44:13 +03:00
< % = form_for @conn , " /sites/ #{ URI . encode_www_form ( @site . domain ) } /monthly-report/recipients " , fn f -> % >
2020-03-06 12:11:38 +03:00
< div class = " flex justify-between my-2 max-w-md " >
2020-03-26 15:22:48 +03:00
< % = email_input f , :recipient , class : " transition bg-gray-100 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 " % >
2020-01-22 12:16:53 +03:00
< % = submit " Add recipient " , class : " button rounded-l-none whitespace-no-wrap " % >
2019-09-10 18:17:48 +03:00
< / div >
< % end % >
< / div >
< % end % >
2019-09-07 17:01:37 +03:00
< / div >
2020-03-06 12:11:38 +03:00
< div 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 " id = " custom-domain " >
< h2 class = " text-xl font-black " > Custom domain < / h2 >
2020-02-26 11:54:21 +03:00
< div class = " my-4 " >
2020-03-02 14:04:59 +03:00
Some browsers and extensions block all analytics services , including privacy - friendly ones like Plausible . < br / > < br / > 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 .
2019-09-02 14:29:19 +03:00
< / div >
2020-03-06 12:11:38 +03:00
< div class = " mt-6 " >
< % = if @site . custom_domain do % >
Configured domain : < b > < % = @site . custom_domain . domain % > < / b >
< % else % >
2020-02-26 11:54:21 +03:00
< % = link ( " Add custom domain " , to : " /sites/ #{ URI . encode_www_form ( @site . domain ) } /custom-domains/new " , class : " button " ) % >
2020-03-06 12:11:38 +03:00
< % end % >
< / div >
2020-02-26 11:54:21 +03:00
< / div >
2020-03-06 12:11:38 +03:00
< % = 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 -> % >
< h2 class = " text-xl font-black " > Javascript snippet < / h2 >
2019-09-02 14:29:19 +03:00
< div class = " my-4 " >
< p > Include this snippet in the < code > & lt ; head & gt ; < / code > of your website . < / p >
< div class = " relative " >
2020-03-26 15:22:48 +03:00
< % = textarea f , :domain , id : " snippet_code " , class : " transition overflow-hidden bg-gray-100 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 % >
2020-03-06 12:11:38 +03:00
< a onclick = " var textarea = document.getElementById('snippet_code'); textarea.focus(); textarea.select(); document.execCommand('copy'); " href = " javascript:void(0) " class = " no-underline text-indigo-500 text-sm hover:underline " >
< svg class = " absolute text-indigo-500 " style = " top: 24px; right: 12px; " xmlns = " http://www.w3.org/2000/svg " width = " 16 " height = " 16 " viewBox = " 0 0 24 24 " fill = " none " stroke = " currentColor " stroke - width = " 2 " stroke - linecap = " round " stroke - linejoin = " round " class = " feather feather-copy " > < rect x = " 9 " y = " 9 " width = " 13 " height = " 13 " rx = " 2 " ry = " 2 " > < / rect > < path d = " M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1 " > < / path > < / svg >
2019-09-02 14:29:19 +03:00
< / a >
< / div >
< / div >
< % end % >
2020-03-06 12:11:38 +03:00
< div class = " max-w-xl mx-auto bg-white shadow-md rounded rounded-t-none border-t-2 border-red-600 px-8 pt-6 pb-8 mt-16 mb-24 " >
< h2 class = " text-xl font-black " > Delete site data < / h2 >
2019-09-02 14:29:19 +03:00
2020-03-06 12:11:38 +03:00
< div class = " my-4 border-b border-gray-300 " > < / div >
2019-09-02 14:29:19 +03:00
< p class = " text-lg " > Deleting the site removes all stats you ' ve collected</p>
2020-03-06 12:11:38 +03:00
< % = 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? " ] % >
2019-09-02 14:29:19 +03:00
< / div >