-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from bunq/bunq/doc#93_gtm
#93 - Added .env and GTM snippet
- Loading branch information
Showing
14 changed files
with
244 additions
and
25 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,2 @@ | ||
GOOGLE_TAG_MANAGER_CONTAINER_ID=GTM-XXXXXX | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
# misc | ||
.DS_Store | ||
.idea | ||
.env | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
|
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 |
---|---|---|
@@ -1,19 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-US"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<meta name="theme-color" content="#000000"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<meta name="theme-color" content="#000000"> | ||
|
||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json"> | ||
<link rel="shortcut icon" href="favicon.ico"> | ||
<title>bunq API Documentation</title> | ||
</head> | ||
<body> | ||
<noscript> | ||
You need to enable JavaScript to run this app. | ||
</noscript> | ||
<div class="header"></div> | ||
<div id="root" class="react-root"></div> | ||
</body> | ||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json"> | ||
<link rel="shortcut icon" href="favicon.ico"> | ||
<title>bunq API Documentation</title> | ||
</head> | ||
<body> | ||
<noscript> | ||
You need to enable JavaScript to run this app. | ||
</noscript> | ||
|
||
<div class="header"></div> | ||
<div id="root" class="react-root"></div> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,66 @@ | ||
// @flow | ||
/** | ||
*/ | ||
export default function initializeCookieConsentBar() { | ||
window.addEventListener("load", () => { | ||
var shouldAddMotionListeners = true; | ||
|
||
window.cookieconsent.initialise({ | ||
position: "bottom", | ||
content: { | ||
message: "We use cookies when you continue to use our website.", | ||
dismiss: "got it!", | ||
link: "Learn more", | ||
href: "https://www.bunq.com/privacy" | ||
}, | ||
container: document.querySelector(".react-root"), | ||
onInitialise: function () { | ||
if (this.hasConsented()) { | ||
initializeAllTracking(); | ||
|
||
shouldAddMotionListeners = false; | ||
} | ||
} | ||
}); | ||
|
||
if (window.cookieconsent.hasInitialised && shouldAddMotionListeners) { | ||
window.addEventListener("scroll", initializeAllTracking); | ||
window.addEventListener("keydown", initializeAllTracking); | ||
window.addEventListener("mousedown", initializeAllTracking); | ||
window.addEventListener("touchstart", initializeAllTracking); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
*/ | ||
function initializeAllTracking() { | ||
initializeGoogleTagManagerIfNeeded(); | ||
|
||
window.removeEventListener("scroll", initializeAllTracking); | ||
window.removeEventListener("keydown", initializeAllTracking); | ||
window.removeEventListener("mousedown", initializeAllTracking); | ||
window.removeEventListener("touchstart", initializeAllTracking); | ||
} | ||
|
||
/** | ||
*/ | ||
function initializeGoogleTagManagerIfNeeded() { | ||
const googleTagManagerContainerId = process.env.REACT_APP_GOOGLE_TAG_MANAGER_CONTAINER_ID; | ||
|
||
if (googleTagManagerContainerId) { | ||
(function(w, d, s, l, i) { | ||
w[l] = w[l] || []; | ||
w[l].push({ | ||
"gtm.start": new Date().getTime(), | ||
event: "gtm.js" | ||
}); | ||
var f = d.getElementsByTagName(s)[0], | ||
j = d.createElement(s), | ||
dl = l !== "dataLayer" ? "&l=" + l : ""; | ||
j.async = true; | ||
j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl; | ||
f.parentNode.insertBefore(j, f); | ||
}) (window, document, "script", "dataLayer", googleTagManagerContainerId); | ||
} | ||
} |
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,99 @@ | ||
@import "variables"; | ||
@import "~cookieconsent/build/cookieconsent.min.css"; | ||
|
||
/* Sizes */ | ||
$min-width-button: 100px; | ||
$size-cookie: 30px; | ||
|
||
/* Borders */ | ||
$border-button: 1px solid $color-white; | ||
|
||
/* Colors */ | ||
$background-color-cookie-consent: #007AFF; | ||
|
||
.cc-grower { | ||
margin: 0 $spacer-small * -1; | ||
} | ||
|
||
.cc-window { | ||
background-color: $background-color-cookie-consent; | ||
|
||
&.cc-banner, | ||
&.cc-floating { | ||
display: block; | ||
text-align: center; | ||
|
||
.cc-message { | ||
display: inline-block; | ||
color: $color-white; | ||
margin-bottom: $spacer-small / 2; | ||
|
||
@media (min-width: $width-viewport-small) { | ||
margin-left: auto; | ||
margin-right: $spacer-medium; | ||
margin-bottom: 0; | ||
} | ||
|
||
a { | ||
color: $color-white; | ||
opacity: 1; | ||
} | ||
|
||
&:before { | ||
content: ""; | ||
display: inline-block; | ||
width: $size-cookie; | ||
height: $size-cookie; | ||
margin-right: $spacer-small * 2; | ||
background-image: $asset-cookie; | ||
background-position: center center; | ||
background-repeat: no-repeat; | ||
background-size: 100% auto; | ||
vertical-align: middle; | ||
} | ||
} | ||
|
||
.cc-message, | ||
.cc-compliance { | ||
font-family: "Open Sans", sans-serif; | ||
} | ||
|
||
.cc-compliance { | ||
@media (min-width: $width-viewport-small) { | ||
display: inline-block; | ||
margin-right: auto; | ||
} | ||
|
||
.cc-dismiss { | ||
color: $color-white; | ||
min-width: $min-width-button; | ||
border: $border-button; | ||
border-radius: 8px; | ||
|
||
&:hover, | ||
&:active, | ||
&:focus { | ||
color: $background-color-cookie-consent; | ||
background-color: $color-white; | ||
text-decoration: none; | ||
} | ||
} | ||
} | ||
} | ||
|
||
&.cc-floating { | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
max-width: 100%; | ||
padding: $spacer-small / 2 $spacer-small; | ||
z-index: $z-index-max; | ||
|
||
.cc-message, | ||
.cc-compliance { | ||
@media (min-width: $width-viewport-small) { | ||
display: inline-block; | ||
} | ||
} | ||
} | ||
} |
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,4 +1,4 @@ | ||
@import "_variables.scss"; | ||
@import "variables"; | ||
|
||
html { | ||
height: 100%; | ||
|
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,4 +1,4 @@ | ||
@import "_variables.scss"; | ||
@import "variables"; | ||
|
||
.sidebar { | ||
display: none; | ||
|
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,4 +1,4 @@ | ||
@import "_variables.scss"; | ||
@import "variables"; | ||
|
||
.sidebar, | ||
.swagger-ui { | ||
|
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
@import "_variables.scss"; | ||
@import "_type.scss"; | ||
@import "_webfonts.scss"; | ||
@import "_custom.scss"; | ||
@import "_sidebar.scss"; | ||
@import "cookie-consent"; | ||
@import "custom"; | ||
@import "sidebar"; | ||
@import "type"; | ||
@import "variables"; | ||
@import "webfonts"; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.