A PHP Error was encountered

Severity: Warning

Message: Undefined variable $page

Filename: front/Articles.php

Line Number: 91

Backtrace:

File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
Line: 91
Function: _error_handler

File: /opt/bitnami/projects/celticproductions.net/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Undefined variable $pages

Filename: front/Articles.php

Line Number: 110

Backtrace:

File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
Line: 110
Function: _error_handler

File: /opt/bitnami/projects/celticproductions.net/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Undefined variable $page

Filename: front/Articles.php

Line Number: 111

Backtrace:

File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
Line: 111
Function: _error_handler

File: /opt/bitnami/projects/celticproductions.net/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Undefined variable $category

Filename: front/Articles.php

Line Number: 113

Backtrace:

File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
Line: 113
Function: _error_handler

File: /opt/bitnami/projects/celticproductions.net/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Undefined variable $articles

Filename: front/Articles.php

Line Number: 114

Backtrace:

File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
Line: 114
Function: _error_handler

File: /opt/bitnami/projects/celticproductions.net/index.php
Line: 315
Function: require_once

Google Analytics API Stacked Pageviews for PHP 4 | Celtic Productions IT

Google Analytics API Stacked Pageviews for PHP 4

  • Home
  • /
  • Technical Articles
  • A PHP Error was encountered

    Severity: Warning

    Message: Trying to access array offset on null

    Filename: front/article.php

    Line Number: 35

    Backtrace:

    File: /opt/bitnami/projects/celticproductions.net/application/views/front/article.php
    Line: 35
    Function: _error_handler

    File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
    Line: 124
    Function: view

    File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
    Line: 117
    Function: view

    File: /opt/bitnami/projects/celticproductions.net/index.php
    Line: 315
    Function: require_once

  • /
  • Google Analytics API Stacked Pageviews for PHP 4
on 10th August
  • seomoz
  • seo
  • google analytics
  • php4
  • csv
  • chart generation
This technique, originally published on SEOMoz, outlines how to generate reports and charts depicting the performance of different sections of a website over a given time frame as opposed to a flat overall view of the website's traffic. The raison d'etre is that different website sections perform differently.

When I came across this article, I was intrigued and thought it invaluable to employ it for our clients. The only downside was the manual collection of data. Thankfully, others also felt this a major drawback and Maki Car Rental produced a couple of PHP files to automate the data collection process.

This worked superbly on some of our clients servers however some were still running PHP 4 so we've made available a version of the code which uses PHP 4 functions rather than the original PHP 5 implementation. We've also tacked on a small UI so customised reports/metrics/date ranges can be produced quickly. The PHP 4 version is available for download here.

This version of the script also allows you to quickly adjust the CSV delimiter by altering the $csv_field_delim variable. Many thanks to those involved, this is an absolutely superb technique for collecting data enabling users of Google Analytics to make valuable business decisions.

As with all articles on Celtic Productions, this article is protected by international copyright laws. It may be linked to (we are of course most grateful of links to our articles), however, it may never be reproduced without the prior express permission of its owners, Celtic Productions.
  • A PHP Error was encountered

    Severity: Warning

    Message: Undefined array key "category"

    Filename: core/MY_Controller.php

    Line Number: 94

    Backtrace:

    File: /opt/bitnami/projects/celticproductions.net/application/core/MY_Controller.php
    Line: 94
    Function: _error_handler

    File: /opt/bitnami/projects/celticproductions.net/application/helpers/general_helper.php
    Line: 16
    Function: get_link_for_article

    File: /opt/bitnami/projects/celticproductions.net/application/views/front/article.php
    Line: 241
    Function: get_link_for_article

    File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
    Line: 124
    Function: view

    File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
    Line: 117
    Function: view

    File: /opt/bitnami/projects/celticproductions.net/index.php
    Line: 315
    Function: require_once

    /articles/18//enabling-gzip-compression-on-your-website.html" class="c-title"> Enabling Gzip compression on your website
    19th November
  • A PHP Error was encountered

    Severity: Warning

    Message: Undefined array key "category"

    Filename: core/MY_Controller.php

    Line Number: 94

    Backtrace:

    File: /opt/bitnami/projects/celticproductions.net/application/core/MY_Controller.php
    Line: 94
    Function: _error_handler

    File: /opt/bitnami/projects/celticproductions.net/application/helpers/general_helper.php
    Line: 16
    Function: get_link_for_article

    File: /opt/bitnami/projects/celticproductions.net/application/views/front/article.php
    Line: 258
    Function: get_link_for_article

    File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
    Line: 124
    Function: view

    File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
    Line: 117
    Function: view

    File: /opt/bitnami/projects/celticproductions.net/index.php
    Line: 315
    Function: require_once

    /articles/12//file-path-and-name-with-spaces-in-batch-file-for-loop.html" class="c-title"> File path and name with spaces in batch file for loop
    7th October
  • A PHP Error was encountered

    Severity: Warning

    Message: Undefined array key "category"

    Filename: core/MY_Controller.php

    Line Number: 94

    Backtrace:

    File: /opt/bitnami/projects/celticproductions.net/application/core/MY_Controller.php
    Line: 94
    Function: _error_handler

    File: /opt/bitnami/projects/celticproductions.net/application/helpers/general_helper.php
    Line: 16
    Function: get_link_for_article

    File: /opt/bitnami/projects/celticproductions.net/application/views/front/article.php
    Line: 258
    Function: get_link_for_article

    File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
    Line: 124
    Function: view

    File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
    Line: 117
    Function: view

    File: /opt/bitnami/projects/celticproductions.net/index.php
    Line: 315
    Function: require_once

    /articles/11//add-floating-point-numbers-in-batch-file.html" class="c-title"> Add floating point numbers in batch file
    7th October
  • A PHP Error was encountered

    Severity: Warning

    Message: Undefined array key "category"

    Filename: core/MY_Controller.php

    Line Number: 94

    Backtrace:

    File: /opt/bitnami/projects/celticproductions.net/application/core/MY_Controller.php
    Line: 94
    Function: _error_handler

    File: /opt/bitnami/projects/celticproductions.net/application/helpers/general_helper.php
    Line: 16
    Function: get_link_for_article

    File: /opt/bitnami/projects/celticproductions.net/application/views/front/article.php
    Line: 258
    Function: get_link_for_article

    File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
    Line: 124
    Function: view

    File: /opt/bitnami/projects/celticproductions.net/application/controllers/front/Articles.php
    Line: 117
    Function: view

    File: /opt/bitnami/projects/celticproductions.net/index.php
    Line: 315
    Function: require_once

    /articles/2//remote-server-backup--ncftp-.html" class="c-title"> Remote Server Backup (ncftp)
    28th March