Skip to content

praxisnetau/silverware-google

Repository files navigation

SilverWare Google Module

Latest Stable Version Latest Unstable Version License

Provides Google Analytics integration, Google site verification, and a Google+ sharing button for use with SilverWare.

Contents

Requirements

Installation

Installation is via Composer:

$ composer require silverware/google

Configuration

As with all SilverStripe modules, configuration is via YAML. Extensions are applied to Page and ContentController for Google integration. An extension is also applied to site configuration which adds a tab for Google settings to the SilverWare Services tab.

Google API Language

By default, the Google API will automatically detect the appropriate language to use for buttons and widgets based on the user locale. However, if you would like to force the API to use a particular language, you can do so using site configuration. Go to Settings > SilverWare > Services > Google > Google API, and select the desired language from the dropdown field.

Usage

Google Sharing Button

Google Sharing Button

Provided is a GoogleSharingButton which is used with the SharingComponent from the SilverWare Social Module. Simply add this button as a child of SharingComponent using the site tree, and your pages will now be able to be shared via Google+.

For more information, see the Google documentation.

Google Analytics

This module provides automatic integration with Google Analytics to measure page views and statistics within your SilverWare app. To do this, you will first need to create a Google Analytics tracking ID.

After you have a tracking ID, simply paste the ID into the Google Analytics section of site configuration, and check the "Enabled" box:

Google Analytics

After saving the settings, you can verify tracking is working by using the Real-Time feature in your Google Analytics account.

Google Site Verification

Some Google features (such as Search Console) require verification of site ownership. Google performs this check by looking for a verification code within the source of the website.

After adding your site as a property to Search Console, Google will ask that you verify ownership. You should see two tabs, "Recommended method" and "Alternate methods":

  1. Click the "Alternate methods" tab.
  2. Click on "HTML tag" from the methods that appear.
  3. Copy the meta tag code that appears, and paste it into the "Verification code" field in site configuration.
  4. Save the site configuration.

It does not matter if you paste the entire meta tag HTML, as it will be detected and only the verification code will remain after saving.

Issues

Please use the GitHub issue tracker for bug reports and feature requests.

Contribution

Your contributions are gladly welcomed to help make this project better. Please see contributing for more information.

Maintainers

Colin Tucker Praxis Interactive
Colin Tucker Praxis Interactive

License

BSD-3-Clause © Praxis Interactive