-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
23 additions
and
42 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
28 changes: 1 addition & 27 deletions
28
packages/consent/consent-wrapper-onetrust/src/standalone/index.ts
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 |
---|---|---|
@@ -1,28 +1,2 @@ | ||
import { withOneTrust } from '../index' | ||
|
||
/** | ||
* usage: | ||
* ```html | ||
* <!-- Add OneTrust Script --> | ||
* <script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" type="text/javascript" charset="UTF-8" data-domain-script="YOUR-DOMAIN-SCRIPT-ID"></script> | ||
* | ||
* <!-- Add Segment Analytics Script --> | ||
* <script> | ||
* !function(){var analytics=window.analytics=window.analytics||[]... | ||
* <!-- Delete analytics.load --> | ||
* </script> | ||
* | ||
* <!-- Add Segment Consent Wrapper Script --> | ||
* <script src="https://unpkg.com/@segment/analytics-consent-wrapper-onetrust/dist/umd/standalone.js"></script> | ||
* | ||
* ``` | ||
*/ | ||
|
||
// If we ever need to support an analytics instance that is renamed something else, we can add support for a custom attribute to the script tag. | ||
if ((window as any).analytics) { | ||
withOneTrust((window as any).analytics) | ||
} else { | ||
console.error( | ||
'Will not load OneTrust wrapper. window.analytics is not defined' | ||
) | ||
} | ||
;(window as any).withOneTrust = withOneTrust |