-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit copies the content of the integration repo into the "integrations" folder. Original repo: https://github.com/segment-integrations/analytics.js-integration-simplereach Readme: https://github.com/segment-integrations/analytics.js-integration-simplereach/blob/master/README.md
- Loading branch information
1 parent
19fb9b9
commit 7b9a329
Showing
7 changed files
with
428 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
2.1.1 / 2016-10-06 | ||
================== | ||
|
||
* Just a quick minor update. | ||
|
||
2.1.0 / 2016-10-06 | ||
================== | ||
|
||
* Now accepts the wonderful name of your track events :) | ||
|
||
2.0.0 / 2016-06-21 | ||
================== | ||
|
||
* Remove Duo compatibility | ||
* Add CI setup (coverage, linting, cross-browser compatibility, etc.) | ||
* Update eslint configuration | ||
|
||
1.0.6 / 2016-05-07 | ||
================== | ||
|
||
* Bump Analytics.js core, tester, integration to use Facade 2.x | ||
|
||
1.0.5 / 2015-09-11 | ||
================== | ||
|
||
* add track function | ||
|
||
1.0.4 / 2015-08-20 | ||
================== | ||
|
||
* override default `__reach_config.url` property of `false` | ||
|
||
1.0.3 / 2015-08-19 | ||
================== | ||
|
||
* populate url and title in page call | ||
|
||
1.0.2 / 2015-08-19 | ||
================== | ||
|
||
* Updating name: Simplereach -> SimpleReach | ||
|
||
1.0.1 / 2015-08-19 | ||
================== | ||
|
||
* Initial implementation, adding to analytics.js | ||
|
||
1.0.0 / 2015-06-09 | ||
================== | ||
|
||
* Initial commit :sparkles: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# analytics.js-integration-simplereach [![Build Status][ci-badge]][ci-link] | ||
|
||
Simplereach 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-simplereach | ||
[ci-badge]: https://circleci.com/gh/segment-integrations/analytics.js-integration-simplereach.svg?style=svg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
'use strict'; | ||
|
||
/** | ||
* Module dependencies. | ||
*/ | ||
|
||
var defaults = require('@ndhoule/defaults'); | ||
var integration = require('@segment/analytics.js-integration'); | ||
|
||
/** | ||
* Expose `Simplereach` integration. | ||
*/ | ||
|
||
var SimpleReach = module.exports = integration('SimpleReach') | ||
.global('__reach_config') | ||
.global('SPR') | ||
.option('pid', '') | ||
.tag('<script src="//d8rk54i4mohrb.cloudfront.net/js/reach.js">'); | ||
|
||
/** | ||
* Initialize. | ||
* http://www.simplereach.com/docs/#standardImplementation | ||
* Some adjustments made to standard implementation | ||
* | ||
* @api public | ||
*/ | ||
|
||
SimpleReach.prototype.initialize = function() { | ||
window.__reach_config = window.__reach_config || {}; | ||
defaults(window.__reach_config, { | ||
pid: this.options.pid, | ||
reach_tracking: false | ||
}); | ||
this.load(this.ready); | ||
}; | ||
|
||
/** | ||
* Loaded? | ||
* | ||
* @api private | ||
* @return {boolean} | ||
*/ | ||
|
||
SimpleReach.prototype.loaded = function() { | ||
return !!window.SPR; | ||
}; | ||
|
||
/** | ||
* Page. | ||
* | ||
* http://www.simplereach.com/docs/ajax/ | ||
* | ||
* @api public | ||
*/ | ||
|
||
SimpleReach.prototype.page = function(page) { | ||
defaults(window.__reach_config, { | ||
url: page.url(), | ||
title: page.title() | ||
}); | ||
|
||
if (window.__reach_config.url === false) { | ||
window.__reach_config.url = page.url(); | ||
} | ||
|
||
window.SPR.collect(window.__reach_config); | ||
}; | ||
|
||
/** | ||
* Page. | ||
* | ||
* http://www.simplereach.com/docs/ajax/ | ||
* | ||
* @api public | ||
*/ | ||
SimpleReach.prototype.track = function(track) { | ||
window.SPR.collect({ | ||
pid: this.options.pid, | ||
reach_tracking: false, | ||
url: track.proxy('context.page.url'), | ||
title: track.proxy('context.page.title'), | ||
ctx_revenue: track.revenue(), | ||
ctx_order_id: track.orderId(), | ||
ctx_event_name: track.event() | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"name": "@segment/analytics.js-integration-simplereach", | ||
"description": "The Simplereach analytics.js integration.", | ||
"version": "2.1.1", | ||
"keywords": [ | ||
"analytics.js", | ||
"analytics.js-integration", | ||
"segment", | ||
"simplereach" | ||
], | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "make test" | ||
}, | ||
"author": "Segment \u003cfriends@segment.com\u003e", | ||
"license": "SEE LICENSE IN LICENSE", | ||
"homepage": "https://github.com/segmentio/analytics.js-integrations/blob/master/integrations/simplereach#readme", | ||
"bugs": { | ||
"url": "https://github.com/segmentio/analytics.js-integrations/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/segmentio/analytics.js-integrations.git" | ||
}, | ||
"dependencies": { | ||
"@ndhoule/defaults": "^2.0.1", | ||
"@segment/analytics.js-integration": "^2.1.0" | ||
}, | ||
"devDependencies": { | ||
"@segment/analytics.js-core": "^3.0.0", | ||
"@segment/analytics.js-integration-tester": "^3.1.0", | ||
"@segment/clear-env": "^2.0.0", | ||
"@segment/eslint-config": "^3.1.1", | ||
"browserify": "^13.0.0", | ||
"browserify-istanbul": "^2.0.0", | ||
"eslint": "^2.9.0", | ||
"eslint-plugin-mocha": "^2.2.0", | ||
"eslint-plugin-require-path-exists": "^1.1.5", | ||
"istanbul": "^0.4.3", | ||
"karma": "1.3.0", | ||
"karma-browserify": "^5.0.4", | ||
"karma-chrome-launcher": "^1.0.1", | ||
"karma-coverage": "^1.0.0", | ||
"karma-junit-reporter": "^1.0.0", | ||
"karma-mocha": "1.0.1", | ||
"karma-phantomjs-launcher": "^1.0.0", | ||
"karma-sauce-launcher": "^1.0.0", | ||
"karma-spec-reporter": "0.0.26", | ||
"mocha": "^2.2.5", | ||
"npm-check": "^5.2.1", | ||
"phantomjs-prebuilt": "^2.1.7", | ||
"watchify": "^3.7.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "@segment/eslint-config/mocha" | ||
} |
Oops, something went wrong.