public function GoogleAnalyticsCounterMessageManager::authenticationInstructions in Google Analytics Counter 8.3
Voluminous on screen instructions about authentication.
Parameters
$web_properties:
Return value
string
Overrides GoogleAnalyticsCounterMessageManagerInterface::authenticationInstructions
File
- src/
GoogleAnalyticsCounterMessageManager.php, line 216
Class
- GoogleAnalyticsCounterMessageManager
- Defines the Google Analytics Counter message manager.
Namespace
Drupal\google_analytics_counterCode
public function authenticationInstructions($web_properties) {
$t_arg = [
':href' => Url::fromRoute('google_analytics_counter.admin_dashboard_form', [], [
'absolute' => TRUE,
])
->toString(),
'@href' => 'Dashboard',
];
$markup_description = $web_properties === 'unauthenticated' ? '<ol><li>' . $this
->t('Fill in the Client ID, Client Secret, Authorized Redirect URI, and optionally Google Project Name in the fields below.') . '</li><ul><li>' . $this
->t('If you don\'t have a Client ID, a Client Secret, an Authorized Redirect URI, and optionally a Google Project Name, follow the instructions in the README.md included with this module or read the <a href="https://www.drupal.org/docs/8/modules/google-analytics-counter" target="_blank">online documentation</a>.') . '</li></ul><li>' . $this
->t('Save configuration.') . '</li><li>' . $this
->t('Click Authenticate in "Authenticate with Google Analytics" above.') . '</li><li>' . $this
->t('If authentication with Google is successful, the ') . '<strong>' . $this
->t(' Google View ') . '</strong>' . $this
->t('field will list your analytics profiles.') . '</li><li>' . $this
->t('Select an analytics profile to collect analytics from and click Save configuration.') . '</li><ul><li>' . $this
->t('If you are not authenticated or if the project you are authenticating to does not have Analytics, no options are available in the') . '<strong>' . $this
->t(' Google View.') . '</strong>' . '</strong></li></ul></ol></p>' : '<p>' . $this
->t('Client ID, Client Secret, and Authorized redirect URI can only be changed when not authenticated.') . '<ol><li>' . $this
->t('Now that you are authenticated with Google Analytics, you MUST select the') . '<strong>' . $this
->t(' Google View ') . '</strong>' . $this
->t('to collect analytics from.') . '</li><li>' . $this
->t('Save configuration.') . '</li><li>' . $this
->t('On the next cron job, analytics from the selected') . '<strong>' . $this
->t(' Google View ') . '</strong>' . $this
->t('will be saved to Drupal.') . '</li><ul><li>' . $this
->t('Information on the <a href=:href>@href</a> page is from the', $t_arg) . '<strong>' . $this
->t(' Google View') . '</strong>' . $this
->t('.') . '</li><li>' . $this
->t('After cron runs, compare pagepaths and pageview totals on the <a href=:href>@href</a> in the Top Twenty Results section with your Google Analytics.', $t_arg) . '</li><li>' . $this
->t('If date range is set to one of Google\'s predefined time intervals, the Pageviews in Drupal should match Google exactly.', $t_arg) . '</li></ul></ol></p>';
return $markup_description;
}