diff -urp /tmp/piwik/piwik.admin.inc /developp/htdocs/drupal/sites/all/modules/piwik/piwik.admin.inc
--- /tmp/piwik/piwik.admin.inc	2010-10-10 18:39:36.000000000 +0200
+++ /developp/htdocs/drupal/sites/all/modules/piwik/piwik.admin.inc	2010-10-19 12:05:39.000000000 +0200
@@ -141,6 +141,26 @@ function piwik_admin_settings_form(&$for
     '#description' => t('A pipe separated list of file extensions that should be tracked when clicked with regular expression support. Example: !extensions', array('!extensions' => PK_TRACKFILES_EXTENSIONS)),
     '#maxlength' => 255,
   );
+  
+  // Allows to configure if and how breadcrumb is used to set the piwikTracker.setDocumentTitle option in js code
+  $form['pagetitleshierarchy'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Page titles hierarchy'),
+    '#collapsible' => TRUE,
+    '#collapsed' => FALSE,
+  );
+  $form['pagetitleshierarchy']['piwik_show_hierarchy_using_breadcrumb'] = array(
+    '#type' => 'checkbox',
+    '#title' => t("Show page titles hierarchy using Drupal's breadcrumb"),
+    '#description' => t("You can use Drupal's breadcrumbs settings to show the site's hierarchy in the Page titles report tab of Piwik"),
+    '#default_value' => variable_get('piwik_show_hierarchy_using_breadcrumb', 1),
+  );
+  $form['pagetitleshierarchy']['piwik_show_hierarchy_exclude_homepage'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Ignore home page level in breadcrumb'),
+    '#description' => t('Allows to prevent from having all the pages under one single "Home" entry. Hits to the home page will still be counted, but for other pages hierarchy will start at level Home+1 in the "Page titles" tab report'),
+    '#default_value' => variable_get('piwik_show_hierarchy_exclude_homepage', 1),
+  );
 
   // Advanced feature configurations.
   $form['advanced'] = array(
diff -urp /tmp/piwik/piwik.module /developp/htdocs/drupal/sites/all/modules/piwik/piwik.module
--- /tmp/piwik/piwik.module	2010-10-10 18:39:36.000000000 +0200
+++ /developp/htdocs/drupal/sites/all/modules/piwik/piwik.module	2010-10-19 15:55:51.000000000 +0200
@@ -76,6 +76,24 @@ function piwik_footer($main = 0) {
 
     $piwik_vars = array();
     $url_custom = '';
+    
+    // Add a custom page title based on the breadcrumb to show site's hierarchy in reports
+    if (variable_get('piwik_show_hierarchy_using_breadcrumb', 1) == 1) {
+      $drupal_breadcrumb = drupal_get_breadcrumb();
+      $piwik_breadcrumb = array();
+      
+      for ($i = 0; $i < count($drupal_breadcrumb); $i++) {
+        if (($i > 0) || (variable_get('piwik_show_hierarchy_exclude_homepage', 1) == 0)) {
+          $encoded_title = urlencode(strip_tags($drupal_breadcrumb[$i]));
+          
+          if (!empty($encoded_title) && ($encoded_title != '/'))
+            array_push($piwik_breadcrumb, $encoded_title);
+        }
+      }
+      
+      if (!empty($piwik_breadcrumb))
+        $url_custom = drupal_to_js(implode('/', $piwik_breadcrumb));
+    }
 
     // Site search tracking support.
     if (module_exists('search') && variable_get('piwik_site_search', FALSE) && arg(0) == 'search' && $keys = search_get_keys()) {
