This repository has been archived by the owner on Apr 3, 2024. It is now read-only.
-
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.
🙅🏻♀️No longer imply consent on interaction (#47)
* No longer imply consent on interaction * Add example
- Loading branch information
1 parent
322fea3
commit 6d2e409
Showing
10 changed files
with
196 additions
and
26 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
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
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
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
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
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,62 @@ | ||
import React from 'react' | ||
import cookies from 'js-cookie' | ||
import { Pane, Heading, Button, Paragraph } from 'evergreen-ui' | ||
import { ConsentManager, openConsentManager } from '../src' | ||
import { | ||
bannerContent, | ||
bannerSubContent, | ||
preferencesDialogContent, | ||
preferencesDialogTitle, | ||
cancelDialogContent, | ||
cancelDialogTitle | ||
} from './common-react' | ||
|
||
export const ImplyConsentOnInteraction = () => { | ||
return ( | ||
<Pane> | ||
<ConsentManager | ||
writeKey="mA3XTMcavCUOQo5DL56VIHWcJMsyhAI7" | ||
otherWriteKeys={['vMRS7xbsjH97Bb2PeKbEKvYDvgMm5T3l']} | ||
bannerContent={bannerContent} | ||
bannerSubContent={bannerSubContent} | ||
preferencesDialogTitle={preferencesDialogTitle} | ||
preferencesDialogContent={preferencesDialogContent} | ||
cancelDialogTitle={cancelDialogTitle} | ||
cancelDialogContent={cancelDialogContent} | ||
implyConsentOnInteraction | ||
/> | ||
|
||
<Pane marginX={100} marginTop={20}> | ||
<Heading> Your website content </Heading> | ||
<Paragraph> | ||
Clicking anywhere on this page will cause the Consent Manager to imply consent. | ||
</Paragraph> | ||
|
||
<Pane display="flex"> | ||
<iframe | ||
src="https://giphy.com/embed/yFQ0ywscgobJK" | ||
width="398" | ||
height="480" | ||
frameBorder="0" | ||
/> | ||
</Pane> | ||
|
||
<div> | ||
<Button onClick={openConsentManager}>Data Collection and Cookie Preferences</Button> | ||
</div> | ||
|
||
<div> | ||
<Heading>to see the banner again:</Heading> | ||
<Button | ||
onClick={() => { | ||
cookies.remove('tracking-preferences') | ||
window.location.reload() | ||
}} | ||
> | ||
Clear tracking preferences cookie | ||
</Button> | ||
</div> | ||
</Pane> | ||
</Pane> | ||
) | ||
} |
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,56 @@ | ||
import React from 'react' | ||
|
||
export const bannerContent = ( | ||
<span> | ||
We use cookies (and other similar technologies) to collect data to improve your experience on | ||
our site. By using our website, you’re agreeing to the collection of data as described in our{' '} | ||
<a | ||
href="https://segment.com/docs/legal/website-data-collection-policy/" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Website Data Collection Policy | ||
</a> | ||
. | ||
</span> | ||
) | ||
export const bannerSubContent = 'You can manage your preferences here!' | ||
export const preferencesDialogTitle = 'Website Data Collection Preferences' | ||
export const preferencesDialogContent = ( | ||
<div> | ||
<p> | ||
Segment uses data collected by cookies and JavaScript libraries to improve your browsing | ||
experience, analyze site traffic, deliver personalized advertisements, and increase the | ||
overall performance of our site. | ||
</p> | ||
<p> | ||
By using our website, you’re agreeing to our{' '} | ||
<a | ||
href="https://segment.com/docs/legal/website-data-collection-policy/" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Website Data Collection Policy | ||
</a> | ||
. | ||
</p> | ||
<p> | ||
The table below outlines how we use this data by category. To opt out of a category of data | ||
collection, select “No” and save your preferences. | ||
</p> | ||
</div> | ||
) | ||
export const cancelDialogTitle = 'Are you sure you want to cancel?' | ||
export const cancelDialogContent = ( | ||
<div> | ||
Your preferences have not been saved. By continuing to use our website, you’re agreeing to our{' '} | ||
<a | ||
href="https://segment.com/docs/legal/website-data-collection-policy/" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Website Data Collection Policy | ||
</a> | ||
. | ||
</div> | ||
) |
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
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
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