From eb283f41b490576d555df3d6ef259f2590c9df56 Mon Sep 17 00:00:00 2001 From: SegmentDestinationsBot Date: Mon, 20 Aug 2018 12:53:46 -0700 Subject: [PATCH] Add integration hubspot This commit copies the content of the integration repo into the "integrations" folder. Original repo: https://github.com/segment-integrations/analytics.js-integration-hubspot Readme: https://github.com/segment-integrations/analytics.js-integration-hubspot/blob/master/README.md --- integrations/hubspot/HISTORY.md | 83 ++++++++++ integrations/hubspot/README.md | 12 ++ integrations/hubspot/lib/index.js | 139 ++++++++++++++++ integrations/hubspot/package.json | 57 +++++++ integrations/hubspot/test/.eslintrc | 3 + integrations/hubspot/test/index.test.js | 211 ++++++++++++++++++++++++ 6 files changed, 505 insertions(+) create mode 100644 integrations/hubspot/HISTORY.md create mode 100644 integrations/hubspot/README.md create mode 100644 integrations/hubspot/lib/index.js create mode 100644 integrations/hubspot/package.json create mode 100644 integrations/hubspot/test/.eslintrc create mode 100644 integrations/hubspot/test/index.test.js diff --git a/integrations/hubspot/HISTORY.md b/integrations/hubspot/HISTORY.md new file mode 100644 index 000000000..71d3d58c8 --- /dev/null +++ b/integrations/hubspot/HISTORY.md @@ -0,0 +1,83 @@ +2.1.3 / 2018-07-06 +================== + * Add support for tabs, carriage returns, new lines, vertical tabs, form feeds + +2.1.2 / 2017-09-28 +================== + + * Bugfix: Upgrade passed-in `identify` to a version with `companyName()` + +2.1.1 / 2017-09-26 +================== + + * Populate Hubspot-reserved `company` from `traits.company.name` + +2.1.0 / 2017-03-16 +================== + + * Bump analytics.js-integration and analytics.js-integration-tester to ^3.x + +2.0.1 / 2016-08-31 +================== + + * fix uppercases and spaces + +2.0.0 / 2016-06-21 +================== + + * Remove Duo compatibility + * Add CI setup (coverage, linting, cross-browser compatibility, etc.) + * Update eslint configuration + +1.0.9 / 2016-05-07 +================== + + * Bump Analytics.js core, tester, integration to use Facade 2.x + +1.0.8 / 2015-11-14 +================== + + * Merge pull request #5 from segment-integrations/revert-4-traits-lowercase + * Revert "map firstname, lastname, and jobtitle." + +1.0.7 / 2015-11-13 +================== + + * Merge pull request #4 from segment-integrations/traits-lowercase + * map firstname, lastname, and jobtitle. + +1.0.6 / 2015-11-10 +================== + + * Add support for semantic name fields to Hubspot + +1.0.5 / 2015-07-07 +================== + + * Map `revenue` to `value` param in `#track` calls + +1.0.4 / 2015-06-30 +================== + + * Replace analytics.js dependency with analytics.js-core + +1.0.3 / 2015-06-30 +================== + + * Send `.event` as `.id`, `properties.id` as `_id` + * Hubspot expects the `id` property to be the event name; any events with the `.id` property were getting messed up previously + +1.0.2 / 2015-06-24 +================== + + * Bump analytics.js-integration version + +1.0.1 / 2015-06-24 +================== + + * Bump analytics.js-integration version + +1.0.0 / 2015-06-09 +================== + + * Initial commit :sparkles: diff --git a/integrations/hubspot/README.md b/integrations/hubspot/README.md new file mode 100644 index 000000000..b0840e5ff --- /dev/null +++ b/integrations/hubspot/README.md @@ -0,0 +1,12 @@ +# analytics.js-integration-hubspot [![Build Status][ci-badge]][ci-link] + +Hubspot integration for [Analytics.js][]. + +## License + +Released under the [MIT license](LICENSE). + + +[Analytics.js]: https://segment.com/docs/libraries/analytics.js/ +[ci-link]: https://circleci.com/gh/segment-integrations/analytics.js-integration-hubspot +[ci-badge]: https://circleci.com/gh/segment-integrations/analytics.js-integration-hubspot.svg?style=svg diff --git a/integrations/hubspot/lib/index.js b/integrations/hubspot/lib/index.js new file mode 100644 index 000000000..5b04a0085 --- /dev/null +++ b/integrations/hubspot/lib/index.js @@ -0,0 +1,139 @@ +'use strict'; + +/** + * Module dependencies. + */ + +var Identify = require('segmentio-facade').Identify; +var convert = require('@segment/convert-dates'); +var integration = require('@segment/analytics.js-integration'); +var push = require('global-queue')('_hsq'); +var each = require('@ndhoule/each'); + +/** + * Expose `HubSpot` integration. + */ + +var HubSpot = module.exports = integration('HubSpot') + .assumesPageview() + .global('_hsq') + .option('portalId', null) + .tag('