MODX EXTRA

Google Analytics

Creator: Ryan Thrash (rthrash)
Updated By: banzai

2.0.1-pl (6 KB) Other Versions Need help installing this extra?

Screenshots

About Google Analytics

Adds a Google Analytics tag to every HTML page of your website. Support the new Universal Analytics code. Provides customisation of the analytics code and position inside your template.

Information

Released
October 2, 2014
Supported Versions
1.0 – Current
Supported Database
MySQL
Downloads
13,348
License
GPLv2

Instructions

Installation

1. Create a new plugin, and paste the contents of this file into the Plugin Code area. Set the plugin name to "Google Analytics" and description to "1.7 Adds Google Analytics code to every page in your site"2. Copy this line into the Plugin Configuration of the Configuration tab:&account=Account;string;UA-000000-0 &testMode=Test Mode;list;true,false;false &trackingNameTV=Alt tracking URL TV name;string; &trackingNamePH=Alt tracking URL placeholder name;string;&extraJs=Chunk containing extra JS;string;3. Enter your Google Account details on the configuration tab4. Check the OnWebPagePrerender box on the System Events tab5. Press Save6. Ensure "Stats Tracking" is enabled in the Site Configuration menu (Tools -> Configuration -> [ Site ] tab )  ** IMPORTANT IF UPGRADING - THIS SETTING WAS NOT RESPECTED BEFORE **

Usage

Once installed, you don't need to do anything else - all HTML pages which have the "Enable Stats Tracking" box ticked in Manager will automatically have the code inserted.Parameters (set in configuration tab)

account = Google Analytics tracking code, which looks like UA-000000-0testMode = boolean - if true, do not send tracking data to Google. Code is outputted as comments, useful for debuggingtrackingNameTV = see ALTERNATIVE TRACKING NAMEStrackingNamePH = see ALTERNATIVE TRACKING NAMESextraJs = name of a chunk containing extra JS, which is inserted into the Google tracking code before the page view is recorded, if you wish to take advantage of GA's custom tracking featuresALTERNATIVE TRACKING NAMESBy default, Google will track the pages based on their [friendly] URL. Sometimes you may want to tell Analytics to report alternative tracking names.

For example to define stages of a goals, but where the URL may not change - e.g. submitting an eForm

The value for the URL that will be tracked can be set either by supplying a Template Variable name - this can then be entered on any page via the Manager

Alternatively the name of a placeholder can be supplied, which can be set by other plugins or snippets. A placeholder value will override a template value.

More

New in Google Analytics 2.0.1

2.1 - Fix for UniversalAnalytics

1.9 - New Option to change code type (UniversalAnalytics/GoogleAnalytics)

1.8 - New Google Universal Analitycs code

More

Current Releases

2.0.1-pl
October 2, 2014
1.0 – Current
More
View Deprecated Releases