nystudio107 /
craft-instantanalytics
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Instant Analytics plugin for Craft CMS |
||
| 4 | * |
||
| 5 | * Instant Analytics brings full Google Analytics support to your Twig templates |
||
| 6 | * |
||
| 7 | * @link https://nystudio107.com |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 8 | * @copyright Copyright (c) 2017 nystudio107 |
||
|
0 ignored issues
–
show
|
|||
| 9 | */ |
||
|
0 ignored issues
–
show
|
|||
| 10 | |||
| 11 | /** |
||
| 12 | * Instant Analytics config.php |
||
| 13 | * |
||
| 14 | * This file exists only as a template for the Instant Analytics settings. |
||
| 15 | * It does nothing on its own. |
||
| 16 | * |
||
| 17 | * Don't edit this file, instead copy it to 'craft/config' as 'instant-analytics.php' |
||
| 18 | * and make your changes there to override default settings. |
||
| 19 | * |
||
| 20 | * Once copied to 'craft/config', this file will be multi-environment aware as |
||
| 21 | * well, so you can have different settings groups for each environment, just as |
||
| 22 | * you do for 'general.php' |
||
| 23 | */ |
||
| 24 | |||
| 25 | return [ |
||
| 26 | /** |
||
| 27 | * The default Google Analytics tracking ID |
||
| 28 | */ |
||
| 29 | 'googleAnalyticsTracking' => '', |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Should the query string be stripped from the page tracking URL? |
||
| 33 | */ |
||
| 34 | 'stripQueryString' => true, |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Should page views be sent automatically when a page view happens? |
||
| 38 | */ |
||
| 39 | 'autoSendPageView' => true, |
||
| 40 | |||
| 41 | /** |
||
| 42 | * If you plan to use Instant Analytics in conjunction with frontend JavaScript, this setting should be on, so that Instant Analytics requires a `clientId` from the frontend-set GA cookie before it will send analytics data. |
||
| 43 | */ |
||
| 44 | 'requireGaCookieClientId' => true, |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Should the GCLID cookie be created if it doesn't exist? |
||
| 48 | */ |
||
| 49 | 'createGclidCookie' => true, |
||
| 50 | |||
| 51 | /** |
||
| 52 | * The field in a Commerce Product Variant that should be used for the category |
||
| 53 | */ |
||
| 54 | 'productCategoryField' => '', |
||
| 55 | |||
| 56 | /** |
||
| 57 | * The field in a Commerce Product Variant that should be used for the brand |
||
| 58 | */ |
||
| 59 | 'productBrandField' => '', |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Whether add to cart events should be automatically sent |
||
| 63 | */ |
||
| 64 | 'autoSendAddToCart' => true, |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Whether remove from cart events should be automatically sent |
||
| 68 | * |
||
| 69 | * @var bool |
||
| 70 | */ |
||
| 71 | 'autoSendRemoveFromCart' => true, |
||
| 72 | |||
| 73 | /** |
||
| 74 | * Whether purchase complete events should be automatically sent |
||
| 75 | */ |
||
| 76 | 'autoSendPurchaseComplete' => true, |
||
| 77 | |||
| 78 | /** |
||
| 79 | * Controls whether Instant Analytics will send analytics data. |
||
| 80 | */ |
||
| 81 | 'sendAnalyticsData' => true, |
||
| 82 | |||
| 83 | /** |
||
| 84 | * Controls whether Instant Analytics will send analytics data when `devMode` is on. |
||
| 85 | */ |
||
| 86 | 'sendAnalyticsInDevMode' => true, |
||
| 87 | |||
| 88 | /** |
||
| 89 | * Controls whether we should filter out bot UserGents. |
||
| 90 | */ |
||
| 91 | 'filterBotUserAgents' => true, |
||
| 92 | |||
| 93 | /** |
||
| 94 | * Controls whether we should exclude users logged into an admin account from Analytics tracking. |
||
| 95 | */ |
||
| 96 | 'adminExclude' => false, |
||
| 97 | |||
| 98 | /** |
||
| 99 | * Controls whether analytics that blocked from being sent should be logged to |
||
| 100 | * storage/logs/web.log |
||
| 101 | * These are always logged if `devMode` is on |
||
| 102 | */ |
||
| 103 | 'logExcludedAnalytics' => true, |
||
| 104 | |||
| 105 | /** |
||
| 106 | * Contains an array of Craft user group handles to exclude from Analytics tracking. If there's a match |
||
| 107 | * for any of them, analytics data is not sent. |
||
| 108 | */ |
||
| 109 | 'groupExcludes' => array( |
||
| 110 | 'some_user_group_handle', |
||
| 111 | ), |
||
| 112 | |||
| 113 | /** |
||
| 114 | * Contains an array of keys that correspond to $_SERVER[] super-global array keys to test against. |
||
| 115 | * Each item in the sub-array is tested against the $_SERVER[] super-global key via RegEx; if there's |
||
| 116 | * a match for any of them, analytics data is not sent. This allows you to filter based on whatever |
||
| 117 | * information you want. |
||
| 118 | * Reference: http://php.net/manual/en/reserved.variables.server.php |
||
| 119 | * RegEx tester: http://regexr.com |
||
| 120 | */ |
||
| 121 | 'serverExcludes' => array( |
||
| 122 | 'REMOTE_ADDR' => array( |
||
| 123 | '/^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*\:)*?:?0*1$/', |
||
| 124 | ), |
||
| 125 | ), |
||
| 126 | ]; |
||
| 127 |