Googlyzer – Display Google Analytics in WordPress

Embed Google Analytics in WordPress

Googlyzer Pro includes shortcodes that enable embedding of charts with real-time data from Google Analytics. Displaying data from Google Analytics in WordPress can be a powerful visual tool to allow web site managers and their users to see the impact of their content. Embedded charts can use page-level data, or site-wide data, can be based on a wide number of metrics and can be produced for any desired date range (assuming there is data available). Examples follow.

Example 1 – Displaying Total Number of Site Visitors Over Last 30 Days

[googlyzerSparkline title='Site Visitors Last 30 Days' metrics=ga:visitors linecolor=orange fillbackground=true]

[googlyzerSparkline title='Site Visitors Last 30 Days' metrics=ga:visitors linecolor=orange fillbackground=true]

Example 2 – Displaying Total Site Pageviews Over Last 6 Months

[googlyzerSparkline title='Site Pageviews in Last 6 Months' linecolor=red minspotcolor=yellow maxspotcolor=green spotcolor=blue start=2011-08-02 end=2012-02-09]

[googlyzerSparkline title='Site Pageviews in Last 6 Months' linecolor=red minspotcolor=yellow maxspotcolor=green spotcolor=blue start=2011-08-02 end=2012-02-09]

Example 3 – Displaying Total Visitors to This Page in Last 6 Months

[googlyzerSparkline title='Page Visitors in Last 30 Days' scope=Page metrics=ga:visitors linecolor=blue fillbackground=true height=100 width=300]

[googlyzerSparkline title='Page Visitors in Last 30 Days' scope=Page metrics=ga:visitors linecolor=blue fillbackground=true height=100 width=300]

Example 4 – Displaying Total Pageviews for This Page

[googlyzerSparkline title='Total Pageviews' scope=Page linecolor=green fillbackground=true height=100 width=300 start=2005-01-01]

[googlyzerSparkline title='Total Pageviews' scope=Page linecolor=green fillbackground=true height=100 width=300 start=2005-01-01]

Supported Shortcode Tags

  • dimensions – Google Analytics dimensions. Only single value supported in this version. Must be prefixed by ‘ga:’ according to standard Google Analytics format. Incorrectly formatted input will be converted to default. Default is ga:date.
    Example:
    dimensions=ga:date
  • end – End date for date range. Must be in YYYY-MM-DD format. Default is current date.
    Example:
    end=2011-12-31
  • fillbackground – Toggle for filling chart area beneath sparkline. Must be a boolean value (true/false). Default is false.
    Example:
    fillbackground=false
  • fillcolor – Background fill color. Ignored unless fillbackground=true. Can be entered as hex value or by web color name. Default is #ADFAFF (light blue).
    Example 1:
    fillcolor=#ADFAFF

    Example 2:

    fillcolor=green
  • height – Height in pixels for sparkline chart. Can be entered as integer only, or with ‘px’ suffix. Default is 75px.
    Example:
    height=75px
  • linecolor – Sparkline color. Can be entered as hex value or by web color name. Default is #FF0000.
    Example 1:
    linecolor=#FF0000

    Example 2:

    linecolor=blue
  • max_results – Maximum number of data values to be returned from Google Analytics. Default is 1000.
    Example:
    max_results=5000
  • maxspotcolor – Maximum data point marker color. Can be entered as hex value or by web color name, set to false to disable. Default is false.
    Example 1:
    maxspotcolor=yellow

    Example 2:

    maxspotcolor=false
  • minspotcolor – Minimum data point marker color. Can be entered as hex value or by web color name, set to false to disable. Default is false.
    Example 1:
    minspotcolor=red

    Example 2:

    minspotcolor=false
  • spotcolor – Last value data point marker color. Can be entered as hex value or by web color name, set to false to disable. Default is false.
    Example 1:
    spotcolor=orange

    Example 2:

    spotcolor=false
  • metrics – Google Analytics metrics. Only single value supported in this version. Must be prefixed by ‘ga:’ according to standard Google Analytics format. Incorrectly formatted input will be converted to default. Default is ga:pageviews.
    Example:
    metrics=ga:pageviews
  • scope – Scope of data to be collected from Google Analytics. Two possible options: ‘Site’ or ‘Page’. Default is Site.
    Example:
    scope=Page
  • sort – Sort order for data retrieved from Google Analytics. Two possible options: ‘ascending’ or ‘descending’. Default is ‘ascending’.
    Example:
    sort=descending
  • sort_column – Sort column for data retrieved from Google Analytics. Can be any metric or dimension included in data request. Default is ga:date.
    Example:
    sort_column=ga:date
  • start – Start date for date range. Must be in YYYY-MM-DD format. Default is 30 days prior to current date.
    Example:
    start=2011-06-30
  • title – Title for sparkline chart.
    Example:
    title="My Chart Title" Default is blank.
  • width – Width in pixels for sparkline chart. Can be entered as integer only, or with ‘px’ suffix. Default is 250px.
    Example:
    width=250px