├── .eslintrc ├── .github ├── issue_template.md └── pull_request_template.md ├── .gitignore ├── CONTRIBUTING.md ├── HISTORY.md ├── LICENSE ├── Makefile ├── README-OLD.md ├── README.md ├── build.js ├── circle.yml ├── karma.conf.ci.js ├── karma.conf.js ├── lib └── index.js ├── package-lock.json ├── package.json └── test ├── .eslintrc └── index.test.js /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@segment/eslint-config/browser/legacy" 3 | } 4 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | 2 | **This repository has been moved to [Analytics JS integrations](https://github.com/segmentio/analytics.js-integrations), please create the issue there** 3 | 4 | See [README](README.md) for more information. Issues/Pull Requests created in this repository are not longer monitored. 5 | 6 | Thank you, 7 | 8 | _The Segment team_ 9 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 2 | **This repository has been moved to [Analytics JS integrations](https://github.com/segmentio/analytics.js-integrations), please move the changes there and create the Pull Request** 3 | 4 | See [README](README.md) for more information. Issues/Pull Requests created in this repository are not longer monitored. 5 | 6 | Thank you, 7 | 8 | _The Segment team_ 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | coverage 2 | node_modules 3 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We're huge fans of open-source, and we absolutely love getting good contributions to **analytics.js**! Integrations are available to thousands of Segment customers and we have hundreds of integrations in already in our queue, so it's important that you do the following _before writing a pull request_. 4 | 5 | 1. Read about our integration options and apply to be a partner: https://segment.com/partners/ 6 | 1. Hear from the Segment team before submitting your pull request. 7 | 8 | ## Getting Set Up 9 | 10 | To start, we'll get you set up with our development environment. All of our development scripts and helpers are written in [node.js](http://nodejs.org), so you'll want to install that first by going to [nodejs.org](http://nodejs.org). 11 | 12 | Then after forking **analytics.js-integrations** just `cd` into the folder and run `make`: 13 | 14 | ```bash 15 | $ cd analytics.js-integration-google-analytics 16 | $ make 17 | ``` 18 | 19 | That will install all of our [npm](http://npmjs.org) and [component](http://component.io) dependencies and compile the latest version of the development build to test against. You can now add your changes to the library, and run `make test` to make sure everything is passing still. 20 | 21 | The commands you'll want to know for development are: 22 | 23 | ```bash 24 | $ make test # runs all of the tests in your terminal 25 | $ make test-browser BROWSERS=Chrome # runs all of the tests in Chrome for nicer debugging 26 | ``` 27 | 28 | ## Writing Tests 29 | 30 | Every contribution should be accompanied by matching tests. If you look inside of the `test/` directory, you'll see we're pretty serious about this. That's because: 31 | 32 | 1. **analytics.js** runs on tons of different types of browsers, operating systems, etc. and we want to make sure it runs well everywhere. 33 | 1. It lets us add new features much, much more quickly. 34 | 1. We aren't insane. 35 | 36 | When adding your own integration, the easiest way to figure out what major things to test is to look at everything you've added to the integration `prototype`. You'll want to write testing groups for `#initialize`, `#load`, `#identify`, `#track`, etc. And each group should test all of the expected functionality. 37 | 38 | The most important thing to writing clean, easy-to-manage integrations is to **keep them small** and **clean up after each test**, so that the environment is never polluted by an individual test. 39 | 40 | If you run into any questions, check out a few of our existing integrations to see how we've done it. 41 | 42 | ## Contributing Checklist 43 | 44 | To help make contributing easy, here's all the things you need to remember: 45 | 46 | - Add your integration file to `/lib`. 47 | - Create a new Integration constructor with the `integration` factory component. 48 | - Add your integration's default options with `.option()`. 49 | - Add an `initialize` method to your integration's `prototype`. 50 | - Add methods you want to support to the `prototype`. (`identify`, `track`, `pageview`, etc.) 51 | - Write tests for all of your integration's logic. 52 | - Run the tests and get everything passing. 53 | - Commit your changes with a nice commit message. 54 | - Submit your pull request. 55 | -------------------------------------------------------------------------------- /HISTORY.md: -------------------------------------------------------------------------------- 1 | 2.16.0 / 2019-03-05 2 | =================== 3 | 4 | * Add support for product level custom dimensions to Product List Viewed and Product List Filtered handlers 5 | 6 | 2.15.0 / 2018-08-07 7 | =================== 8 | 9 | * Fix casing from abmiguous docs 10 | * Bump version 11 | * Add lodash to package.json 12 | * Correct casing on parameter name 13 | * Change amp id setting name 14 | 15 | 2.15.0 / 2018-08-06 16 | ================== 17 | 18 | * Change amp id setting name 19 | 20 | 2.14.0 / 2018-03-28 21 | ================= 22 | 23 | * Support position property as part of product data. 24 | 25 | 2.13.0 / 2018-02-26 26 | ================= 27 | 28 | * Support product-level custom dimensions for enhanced ecommerce events. 29 | 30 | 2.12.0 / 2018-02-06 31 | ================= 32 | 33 | * Support custom dimensions for enhanced ecommerce events. 34 | 35 | 2.9.6 / 2017-11-28 36 | ================= 37 | 38 | * Add support for useGoogleAmpClientId option. 39 | 40 | 2.9.5 / 2017-10-26 41 | ================= 42 | 43 | * Release to support reversion of failed deploy. 44 | 45 | 2.9.4 / 2017-08-31 46 | ================= 47 | 48 | * Fix tracker naming from 2.9 49 | 50 | 2.9.3 / 2017-08-28 51 | ================== 52 | 53 | * Fix breaking changes in 2.9.1 54 | 55 | 2.9.2 / 2017-08-25 56 | ================== 57 | 58 | * Revert 2.9.0 and 2.9.1 59 | 60 | 2.9.1 / 2017-08-25 61 | ================== 62 | 63 | * Gate naming the GA tracker with an option 64 | 65 | 2.9.0 / 2017-24-08 66 | ================== 67 | 68 | * Use custom name for tracker rather than default unnamed 69 | 70 | 2.8.0 / 2017-06-13 71 | ================== 72 | 73 | * Extend previous change to apply for custom properties of `page` events. 74 | 75 | 2.7.0 / 2017-05-31 76 | ================== 77 | 78 | * Add an interface option to stop the integration from setting custom metrics/dimensions to the global GA tracker object 79 | 80 | 2.6.0 / 2017-05-10 81 | ================== 82 | 83 | * Sets id, when present, as a custom dimension on ga tracker object out of the box 84 | 85 | 2.5.1 / 2017-05-05 86 | ================== 87 | 88 | * Remove excess pageview from addImpression-bound events 89 | 90 | 2.5.0 / 2017-04-27 91 | ================== 92 | 93 | * Allow user to override global nonInteraction setting 94 | 95 | 2.4.1 / 2017-03-09 96 | ================== 97 | 98 | * Renamed 'sorters' to 'sorts' to match spec 99 | * Protected against non-array inputs 100 | 101 | 2.4.0 / 2017-03-07 102 | ================== 103 | 104 | * Add Support for addImpression action 105 | 106 | 2.3.0 / 2016-12-08 107 | ================== 108 | 109 | * Add Support for Optimize 110 | 111 | 2.2.0 / 2016-09-06 112 | ================== 113 | 114 | * support spec v2 115 | 116 | 2.1.2 / 2016-08-31 117 | ================== 118 | 119 | * update order started to checkout started 120 | 121 | 2.1.1 / 2016-08-16 122 | ================== 123 | 124 | * Fix for release 125 | 126 | 2.1.0 / 2016-08-16 127 | ================== 128 | 129 | * update ecommerce spec syntax to v2 130 | 131 | 2.0.0 / 2016-06-21 132 | ================== 133 | 134 | * Remove Duo compatibility 135 | * Add CI setup (coverage, linting, cross-browser compatibility, etc.) 136 | * Update eslint configuration 137 | 138 | 1.4.3 / 2016-05-07 139 | ================== 140 | 141 | * Bump Analytics.js core, tester, integration to use Facade 2.x 142 | 143 | 1.4.2 / 2016-04-28 144 | ================== 145 | 146 | * Changed props.category to track.category() so that it takes into account alternative casings. 147 | 148 | 1.4.1 / 2016-04-25 149 | ================== 150 | 151 | * add support for defensive referrer override 152 | 153 | 1.4.0 / 2016-02-13 154 | ================== 155 | 156 | * Merge pull request #21 from segment-integrations/add-sample-rate 157 | * Added non default sampleRate. 158 | * Added sampleRate. 159 | * Release 1.3.2 160 | * Merge pull request #19 from segment-integrations/add-list-prop-EE 161 | * add optional list prop to EE events 162 | * Release 1.3.1 163 | * Merge pull request #18 from segment-integrations/fix/metrics 164 | * refactor metrics/dimension/cg decoration factor to accomodate mapping the same property to multiple fields 165 | * Release 1.3.0 166 | * Merge pull request #16 from lukebussey/master 167 | * Adds support for setting content groupings via tracking code. Google Analytics supports 1-5 content groupings which are set in the same manner as metrics and dimensions. E.g. `ga('set', 'contentGroup', '');` This commit adds support for setting content groupings in the same way that metrics and dimensions are set. 168 | * Release 1.2.0 169 | * Merge pull request #14 from segment-integrations/fix/single-page 170 | * omit location from subsequent page() calls 171 | * Release 1.1.2 172 | * Merge pull request #11 from segment-integrations/stringify-booleans 173 | * stringify booleans for cm 174 | * Release 1.1.0 175 | * Merge pull request #10 from segment-integrations/add-coupon-product-level 176 | * support enhanced eccommerce product coupon level 177 | 178 | 1.3.2 / 2016-02-03 179 | ================== 180 | 181 | * add optional list prop to EE events 182 | 183 | 1.3.1 / 2016-01-28 184 | ================== 185 | 186 | * refactor metrics/dimension/cg decoration factor to accomodate mapping the same property to multiple fields 187 | 188 | 1.3.0 / 2016-01-26 189 | ================== 190 | 191 | * Adds support for setting content groupings via tracking code. Google Analytics supports 1-5 content groupings which are set in the same manner as metrics and dimensions. E.g. `ga('set', 'contentGroup', '');` This commit adds support for setting content groupings in the same way that metrics and dimensions are set. 192 | 193 | 1.2.0 / 2016-01-12 194 | ================== 195 | 196 | * omit location from subsequent page() calls 197 | 198 | 1.1.2 / 2015-09-11 199 | ================== 200 | 201 | * stringify boolean custom metrics or dimensions 202 | 203 | 1.1.0 / 2015-08-19 204 | ================== 205 | 206 | * support enhanced eccommerce to product coupon level 207 | 208 | 1.0.5 / 2015-08-06 209 | ================== 210 | 211 | * Merge pull request #9 from segment-integrations/label-fix 212 | * add label field to GA enhanced ecommerce calls. 213 | 214 | 1.0.4 / 2015-06-30 215 | ================== 216 | 217 | * Replace analytics.js dependency with analytics.js-core 218 | 219 | 1.0.3 / 2015-06-30 220 | ================== 221 | 222 | * Replace analytics.js dependency with analytics.js-core 223 | 224 | 1.0.2 / 2015-06-24 225 | ================== 226 | 227 | * Bump analytics.js-integration version 228 | 229 | 1.0.1 / 2015-06-24 230 | ================== 231 | 232 | * Bump analytics.js-integration version 233 | 234 | 1.0.0 / 2015-06-09 235 | ================== 236 | 237 | * Initial commit :sparkles: 238 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2015 Segment.io 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ## 2 | # Binaries 3 | ## 4 | 5 | ESLINT := node_modules/.bin/eslint 6 | KARMA := node_modules/.bin/karma 7 | 8 | ## 9 | # Files 10 | ## 11 | 12 | LIBS = $(shell find lib -type f -name "*.js") 13 | TESTS = $(shell find test -type f -name "*.test.js") 14 | SUPPORT = $(wildcard karma.conf*.js) 15 | ALL_FILES = $(LIBS) $(TESTS) $(SUPPORT) 16 | 17 | ## 18 | # Program options/flags 19 | ## 20 | 21 | # A list of options to pass to Karma 22 | # Overriding this overwrites all options specified in this file (e.g. BROWSERS) 23 | KARMA_FLAGS ?= 24 | 25 | # A list of Karma browser launchers to run 26 | # http://karma-runner.github.io/0.13/config/browsers.html 27 | BROWSERS ?= 28 | ifdef BROWSERS 29 | KARMA_FLAGS += --browsers $(BROWSERS) 30 | endif 31 | 32 | ifdef CI 33 | KARMA_CONF ?= karma.conf.ci.js 34 | else 35 | KARMA_CONF ?= karma.conf.js 36 | endif 37 | 38 | # Mocha flags. 39 | GREP ?= . 40 | 41 | ## 42 | # Tasks 43 | ## 44 | 45 | # Install node modules. 46 | node_modules: package.json $(wildcard node_modules/*/package.json) 47 | @npm install 48 | @touch $@ 49 | 50 | # Install dependencies. 51 | install: node_modules 52 | 53 | # Remove temporary files and build artifacts. 54 | clean: 55 | rm -rf *.log coverage 56 | .PHONY: clean 57 | 58 | # Remove temporary files, build artifacts, and vendor dependencies. 59 | distclean: clean 60 | rm -rf node_modules 61 | .PHONY: distclean 62 | 63 | # Lint JavaScript source files. 64 | lint: install 65 | @$(ESLINT) $(ALL_FILES) 66 | .PHONY: lint 67 | 68 | # Attempt to fix linting errors. 69 | fmt: install 70 | @$(ESLINT) --fix $(ALL_FILES) 71 | .PHONY: fmt 72 | 73 | # Run browser unit tests in a browser. 74 | test-browser: install 75 | @$(KARMA) start $(KARMA_FLAGS) $(KARMA_CONF) 76 | 77 | # Default test target. 78 | test: lint test-browser 79 | .PHONY: test 80 | .DEFAULT_GOAL = test 81 | -------------------------------------------------------------------------------- /README-OLD.md: -------------------------------------------------------------------------------- 1 | # analytics.js-integration-google-analytics [![Build Status][ci-badge]][ci-link] 2 | 3 | Google Analytics integration for [Analytics.js][]. 4 | 5 | ## License 6 | 7 | Released under the [MIT license](LICENSE). 8 | 9 | 10 | [Analytics.js]: https://segment.com/docs/libraries/analytics.js/ 11 | [ci-link]: https://circleci.com/gh/segment-integrations/analytics.js-integration-google-analytics 12 | [ci-badge]: https://circleci.com/gh/segment-integrations/analytics.js-integration-google-analytics.svg?style=svg 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # [MOVED] Analytics JS integration google-analytics 3 | 4 | **This repository has been moved to the open source [Analytics JS Integrations](https://github.com/segmentio/analytics.js-integrations).** 5 | 6 | If you want to fork, contribute, or open issues, please do it in the new repository. Existing issues/pull requests will be addressed in the new location. 7 | 8 | * [New location](https://github.com/segmentio/analytics.js-integrations/tree/master/integrations/google-analytics) 9 | * Last release for this repository: [2.16.0](https://github.com/segment-integrations/analytics.js-integration-google-analytics/releases/tag/2.16.0) 10 | * [Commit](https://github.com/segmentio/analytics.js-integrations/commit/81227f82ce027719c991e0e9ac440174084331c3) 11 | * [Previous version of this README](README-OLD.md) 12 | 13 | Released under the [MIT license](LICENSE). 14 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | node: 3 | version: 4 4 | environment: 5 | NPM_CONFIG_PROGRESS: false 6 | NPM_CONFIG_SPIN: false 7 | SAUCE_ACCESS_KEY: 80dcffc2-c9a2-45e2-9fb7-87b29a6cd986 8 | SAUCE_USERNAME: segment-oss 9 | TEST_REPORTS_DIR: $CIRCLE_TEST_REPORTS 10 | 11 | dependencies: 12 | pre: 13 | - npm config set "//registry.npmjs.org/:_authToken" $NPM_AUTH 14 | - npm -g install codecov 15 | override: 16 | - make install 17 | 18 | test: 19 | override: 20 | - make test 21 | post: 22 | - cp -R coverage $CIRCLE_ARTIFACTS/ 23 | - codecov 24 | 25 | deployment: 26 | publish: 27 | owner: segment-integrations 28 | # Works on e.g. `1.0.0-alpha.1` 29 | tag: /[0-9]+(\.[0-9]+)*(-.+)?/ 30 | commands: 31 | - npm publish . -------------------------------------------------------------------------------- /karma.conf.ci.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | 'use strict'; 3 | 4 | var baseConfig = require('./karma.conf'); 5 | var customLaunchers = { 6 | sl_chrome_latest: { 7 | base: 'SauceLabs', 8 | browserName: 'chrome', 9 | platform: 'linux', 10 | version: 'latest' 11 | }, 12 | sl_chrome_latest_1: { 13 | base: 'SauceLabs', 14 | browserName: 'chrome', 15 | platform: 'linux', 16 | version: 'latest-1' 17 | }, 18 | sl_firefox_latest: { 19 | base: 'SauceLabs', 20 | browserName: 'firefox', 21 | platform: 'linux', 22 | version: 'latest' 23 | }, 24 | sl_firefox_latest_1: { 25 | base: 'SauceLabs', 26 | browserName: 'firefox', 27 | platform: 'linux', 28 | version: 'latest-1' 29 | }, 30 | sl_safari_9: { 31 | base: 'SauceLabs', 32 | browserName: 'safari', 33 | version: '9.0' 34 | }, 35 | sl_ie_9: { 36 | base: 'SauceLabs', 37 | browserName: 'internet explorer', 38 | version: '9' 39 | }, 40 | sl_ie_10: { 41 | base: 'SauceLabs', 42 | browserName: 'internet explorer', 43 | version: '10' 44 | }, 45 | sl_ie_11: { 46 | base: 'SauceLabs', 47 | browserName: 'internet explorer', 48 | version: '11' 49 | }, 50 | sl_edge_latest: { 51 | base: 'SauceLabs', 52 | browserName: 'microsoftedge' 53 | } 54 | }; 55 | 56 | module.exports = function(config) { 57 | baseConfig(config); 58 | 59 | if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) { 60 | throw new Error('SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are required but are missing'); 61 | } 62 | 63 | config.set({ 64 | browserDisconnectTolerance: 1, 65 | 66 | /** 67 | * We add the Disconnect and Activity timeouts here to help IE9 and Edge. With this many tests, they end up 68 | * taking a long time to complete. This lets them run over all of their tests. 69 | */ 70 | browserDisconnectTimeout: 60000, 71 | 72 | browserNoActivityTimeout: 60000, 73 | 74 | singleRun: true, 75 | 76 | reporters: ['progress', 'junit', 'coverage'], 77 | 78 | browsers: ['PhantomJS'].concat(Object.keys(customLaunchers)), 79 | 80 | customLaunchers: customLaunchers, 81 | 82 | junitReporter: { 83 | outputDir: process.env.TEST_REPORTS_DIR, 84 | suite: require('./package.json').name 85 | }, 86 | 87 | sauceLabs: { 88 | testName: require('./package.json').name 89 | }, 90 | 91 | coverageReporter: { 92 | reporters: [ 93 | { type: 'lcov' } 94 | ] 95 | } 96 | }); 97 | }; 98 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | 'use strict'; 3 | 4 | module.exports = function(config) { 5 | config.set({ 6 | files: [ 7 | 'test/**/*.test.js' 8 | ], 9 | 10 | browsers: ['PhantomJS'], 11 | 12 | frameworks: ['browserify', 'mocha'], 13 | 14 | reporters: ['spec', 'coverage'], 15 | 16 | preprocessors: { 17 | 'test/**/*.js': 'browserify' 18 | }, 19 | 20 | client: { 21 | mocha: { 22 | grep: process.env.GREP, 23 | reporter: 'html', 24 | timeout: 10000 25 | } 26 | }, 27 | 28 | browserify: { 29 | debug: true, 30 | transform: [ 31 | [ 32 | 'browserify-istanbul', 33 | { 34 | instrumenterConfig: { 35 | embedSource: true 36 | } 37 | } 38 | ] 39 | ] 40 | }, 41 | 42 | coverageReporter: { 43 | reporters: [ 44 | { type: 'text' }, 45 | { type: 'html' }, 46 | { type: 'json' } 47 | ] 48 | } 49 | }); 50 | }; 51 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | 7 | var Track = require('segmentio-facade').Track; 8 | var defaults = require('@ndhoule/defaults'); 9 | var dot = require('obj-case'); 10 | var each = require('component-each'); 11 | var integration = require('@segment/analytics.js-integration'); 12 | var is = require('is'); 13 | var len = require('object-component').length; 14 | var push = require('global-queue')('_gaq'); 15 | var reject = require('reject'); 16 | var useHttps = require('use-https'); 17 | var extend = require('extend'); 18 | var user; 19 | 20 | /** 21 | * Expose plugin. 22 | */ 23 | 24 | module.exports = exports = function(analytics) { 25 | // eslint-disable-next-line no-use-before-define 26 | analytics.addIntegration(GA); 27 | user = analytics.user(); 28 | }; 29 | 30 | /** 31 | * Expose `GA` integration. 32 | * 33 | * http://support.google.com/analytics/bin/answer.py?hl=en&answer=2558867 34 | * https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration#_gat.GA_Tracker_._setSiteSpeedSampleRate 35 | */ 36 | 37 | var GA = exports.Integration = integration('Google Analytics') 38 | .readyOnLoad() 39 | .global('ga') 40 | .global('gaplugins') 41 | .global('_gaq') 42 | .global('GoogleAnalyticsObject') 43 | .option('anonymizeIp', false) 44 | .option('useGoogleAmpClientId', false) 45 | .option('classic', false) 46 | .option('contentGroupings', {}) 47 | .option('dimensions', {}) 48 | .option('domain', 'auto') 49 | .option('doubleClick', false) 50 | .option('enhancedEcommerce', false) 51 | .option('enhancedLinkAttribution', false) 52 | .option('ignoredReferrers', null) 53 | .option('includeSearch', false) 54 | .option('setAllMappedProps', true) 55 | .option('metrics', {}) 56 | .option('nonInteraction', false) 57 | .option('sendUserId', false) 58 | .option('siteSpeedSampleRate', 1) 59 | .option('sampleRate', 100) 60 | .option('trackCategorizedPages', true) 61 | .option('trackNamedPages', true) 62 | .option('trackingId', '') 63 | .option('optimize', '') 64 | .option('nameTracker', false) 65 | .tag('library', '