Skip to content

Commit

Permalink
Merge pull request #21 from juriansluiman/feature/disable-by-config
Browse files Browse the repository at this point in the history
Create a configuration option to turn off tracking
  • Loading branch information
Jurian Sluiman committed Apr 29, 2013
2 parents a5ee912 + 8bee68c commit dd40189
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ public function getServiceConfig()
$tracker->setAllowLinker($config['allow_linker']);
}

if (false === $config['enable']) {
$tracker->setEnableTracking(false);
}

return $tracker;
},
),
Expand Down
1 change: 1 addition & 0 deletions config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

return array(
'google_analytics' => array(
'enable' => true,
'id' => '',
'domain_name' => '',
'allow_linker' => false,
Expand Down
9 changes: 9 additions & 0 deletions config/slmgoogleanalytics.global.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ $googleAnalytics = array(
*/
'domain_name' => '',
'allow_linker' => false,

/**
* Disable/enable page tracking
*
* It is adviced to turn off tracking in a development/staging environment. Put this
* configuration option in your local.php in the autoload folder and set "enable" to
* false.
*/
// 'enable' => false,
);

/**
Expand Down

0 comments on commit dd40189

Please sign in to comment.