{% extends "_layouts/cp" %} {% set crumbs = [ { label: "Settings"|t('analytics'), url: url('settings') }, { label: "Plugins"|t('analytics'), url: url('settings/plugins') }, { label: "Analytics"|t('analytics'), url: url('analytics/settings') } ] %} {% set title = "OAuth Settings"|t('analytics')%} {% import "_includes/forms" as forms %} {% set content %}
{{ csrfInput() }}

{{ 'Create the OAuth application'|t('analytics') }}

{{ 'Go to the {link} and create a new project or use an existing one.'|t('analytics', {link: ''~'Google API Console'|t('analytics')~''})|raw }}

{{ "In API & Services → Library, search for “analytics”, and enable the “Google Analytics API” and “Google Analytics Reporting API”."|t('analytics')|raw }}

{{ "In API & Services → Credentials, click the “Create credentials” button and create a new “OAuth client ID” of type “Web Application”."|t('analytics', {link: ''~'Google API Console'|t('analytics')~''})|raw }}

{{ "Configure the client with the following javascript origin and redirect urls."|t('analytics') }}

{{ 'Configure the OAuth client'|t('analytics') }}

{{ 'Once the OAuth client is created, Google will provide you with a client ID and secret.'|t('analytics') }}

{{ ("Copy the client ID & secret from the "~'Google Api Console'|t('analytics')~" under the API Manager → Credentials tab, paste them below and save.")|raw }}

{{ forms.autosuggestField({ label: "Client ID", name: 'settings[oauthClientId]', value: settings.oauthClientId, suggestions: craft.cp.getEnvSuggestions(), suggestEnvVars: true, }) }} {{ forms.autosuggestField({ label: "Client Secret", name: 'settings[oauthClientSecret]', value: settings.oauthClientSecret, suggestions: craft.cp.getEnvSuggestions(), suggestEnvVars: true, }) }}
{% endset %}