@openeventkit/event-site 2.0.115 → 2.0.117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/gatsby-browser.js +28 -21
- package/gatsby-config.mjs +13 -9
- package/gatsby-node.js +25 -27
- package/package.json +6 -4
- package/plugins/gatsby-plugin-google-tagmanager/.babelrc +9 -0
- package/plugins/gatsby-plugin-google-tagmanager/CHANGELOG.md +793 -0
- package/plugins/gatsby-plugin-google-tagmanager/LICENSE +22 -0
- package/plugins/gatsby-plugin-google-tagmanager/README.md +102 -0
- package/plugins/gatsby-plugin-google-tagmanager/gatsby-browser.js +99 -0
- package/plugins/gatsby-plugin-google-tagmanager/gatsby-node.js +53 -0
- package/plugins/gatsby-plugin-google-tagmanager/gatsby-ssr.js +127 -0
- package/plugins/gatsby-plugin-google-tagmanager/index.js +1 -0
- package/plugins/gatsby-plugin-google-tagmanager/package.json +48 -0
- package/src/cms/config/collections/defaultPagesCollection/invitationsRejectPage/index.js +6 -6
- package/src/components/AttendeeToAttendeeWidgetComponent.js +7 -8
- package/src/components/Footer/template.js +3 -2
- package/src/components/FooterMarketing.js +1 -1
- package/src/components/LogoutButton.js +6 -7
- package/src/components/MarketingHero/ImagesColumn.js +2 -2
- package/src/components/MarketingHero/index.js +1 -1
- package/src/components/RegistrationLiteComponent.js +2 -4
- package/src/components/Seo.js +3 -3
- package/src/content/site-settings/index.json +50 -1
- package/src/defaults/colors.json +33 -1
- package/src/styles/colors.scss +36 -33
- package/src/styles/fonts.scss +2 -2
- package/src/templates/marketing-page-template/MainColumn.js +54 -43
- package/src/templates/marketing-page-template/index.js +14 -14
- package/src/utils/EventEmitter.js +26 -0
- package/src/utils/cookies/CookieManager.js +27 -0
- package/src/utils/cookies/CookieManagerProvider.js +15 -0
- package/src/utils/cookies/providers/KlaroProvider.js +81 -0
- package/src/utils/cookies/services.js +57 -0
- package/src/utils/envVariables.js +94 -94
- package/src/utils/eventTriggers.js +19 -0
- package/src/utils/filePath.js +2 -2
- package/src/utils/hooks/index.js +3 -1
- package/src/utils/hooks/useEventListener.js +15 -0
- package/src/utils/hooks/useResize.js +3 -8
- package/src/utils/scssUtils.js +146 -0
- package/src/utils/tag-manager/TagManager.js +41 -0
- package/src/utils/tag-manager/TagManagerProvider.js +7 -0
- package/src/utils/tag-manager/providers/GoogleTagManagerProvider.js +49 -0
- package/src/utils/useSiteSettings.js +1 -5
- package/src/utils/analytics/AnalyticsManager.js +0 -28
- package/src/utils/analytics/AnalyticsProvider.js +0 -7
- package/src/utils/analytics/events.js +0 -1
- package/src/utils/analytics/providers/GoogleTagManagerProvider.js +0 -38
- package/src/utils/cssUtils.js +0 -62
- package/src/utils/customEvents/CustomEventManager.js +0 -22
- package/src/utils/customEvents/index.js +0 -15
- package/src/utils/customEvents/useCustomEvent.js +0 -13
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 Gatsbyjs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# gatsby-plugin-google-tagmanager
|
|
2
|
+
|
|
3
|
+
Easily add Google Tagmanager to your Gatsby site.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
`npm install gatsby-plugin-google-tagmanager`
|
|
8
|
+
|
|
9
|
+
## How to use
|
|
10
|
+
|
|
11
|
+
// In your gatsby-config.js
|
|
12
|
+
plugins: [
|
|
13
|
+
{
|
|
14
|
+
resolve: "gatsby-plugin-google-tagmanager",
|
|
15
|
+
options: {
|
|
16
|
+
id: "YOUR_GOOGLE_TAGMANAGER_ID",
|
|
17
|
+
|
|
18
|
+
// Include GTM in development.
|
|
19
|
+
//
|
|
20
|
+
// Defaults to false meaning GTM will only be loaded in production.
|
|
21
|
+
includeInDevelopment: false,
|
|
22
|
+
|
|
23
|
+
// datalayer to be set before GTM is loaded
|
|
24
|
+
// should be an object or a function that is executed in the browser
|
|
25
|
+
//
|
|
26
|
+
// Defaults to null
|
|
27
|
+
defaultDataLayer: { platform: "gatsby" },
|
|
28
|
+
|
|
29
|
+
// Specify optional GTM environment details.
|
|
30
|
+
gtmAuth: "YOUR_GOOGLE_TAGMANAGER_ENVIRONMENT_AUTH_STRING",
|
|
31
|
+
gtmPreview: "YOUR_GOOGLE_TAGMANAGER_ENVIRONMENT_PREVIEW_NAME",
|
|
32
|
+
dataLayerName: "YOUR_DATA_LAYER_NAME",
|
|
33
|
+
|
|
34
|
+
// Name of the event that is triggered
|
|
35
|
+
// on every Gatsby route change.
|
|
36
|
+
//
|
|
37
|
+
// Defaults to gatsby-route-change
|
|
38
|
+
routeChangeEventName: "YOUR_ROUTE_CHANGE_EVENT_NAME",
|
|
39
|
+
// Defaults to false
|
|
40
|
+
enableWebVitalsTracking: true,
|
|
41
|
+
// Defaults to https://www.googletagmanager.com
|
|
42
|
+
selfHostedOrigin: "YOUR_SELF_HOSTED_ORIGIN",
|
|
43
|
+
// Defaults to gtm.js
|
|
44
|
+
selfHostedPath: "YOUR_SELF_HOSTED_PATH",
|
|
45
|
+
|
|
46
|
+
// Defer loading of GTM script until consent is given.
|
|
47
|
+
deferLoading: true,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
If you like to use data at runtime for your defaultDataLayer you can do that by defining it as a function.
|
|
53
|
+
|
|
54
|
+
// In your gatsby-config.js
|
|
55
|
+
plugins: [
|
|
56
|
+
{
|
|
57
|
+
resolve: "gatsby-plugin-google-tagmanager",
|
|
58
|
+
options: {
|
|
59
|
+
// datalayer to be set before GTM is loaded
|
|
60
|
+
// should be a stringified object or object
|
|
61
|
+
//
|
|
62
|
+
// Defaults to null
|
|
63
|
+
defaultDataLayer: function () {
|
|
64
|
+
return {
|
|
65
|
+
pageType: window.pageType,
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
This plugin only initiates the tag manager _container_. If you want to use Google Analytics, please also add `gatsby-plugin-google-analytics`.
|
|
73
|
+
|
|
74
|
+
If you want to link analytics use with anything inside the container (for example, a cookie consent manager such as OneTrust), you will need to ensure that the tag manager script comes _before_ the analytics script in your `gatsby-config.js`.
|
|
75
|
+
|
|
76
|
+
#### Tracking routes
|
|
77
|
+
|
|
78
|
+
This plugin will fire a new event called `gatsby-route-change` (or as in the `gatsby-config.js` configured `routeChangeEventName`) whenever a route is changed in your Gatsby application. To record this in Google Tag Manager, we will need to add a trigger to the desired tag to listen for the event:
|
|
79
|
+
|
|
80
|
+
1. Visit the [Google Tag Manager console](https://tagmanager.google.com/) and click on the workspace for your site.
|
|
81
|
+
2. Navigate to the desired tag using the 'Tags' tab of the menu on the right hand side.
|
|
82
|
+
3. Under "Triggering", click the pencil icon, then the "+" button to add a new trigger.
|
|
83
|
+
4. In the "Choose a trigger" window, click on the "+" button again.
|
|
84
|
+
5. Choose the trigger type by clicking the pencil button and clicking "Custom event". For event name, enter `gatsby-route-change` (or as in the `gatsby-config.js` configured `routeChangeEventName`).
|
|
85
|
+
|
|
86
|
+
This tag will now catch every route change in Gatsby, and you can add Google tag services as you wish to it.
|
|
87
|
+
|
|
88
|
+
#### Tracking Core Web Vitals
|
|
89
|
+
|
|
90
|
+
Optimizing for the quality of user experience is key to the long-term success of any site on the web. Capturing Real user metrics (RUM) helps you understand the experience of your user/customer. By setting `enableWebVitalsTracking` to `true`, GTM will get ["core-web-vitals"](https://web.dev/vitals/) events with their values.
|
|
91
|
+
|
|
92
|
+
You can save this data in Google Analytics or any database of your choosing.
|
|
93
|
+
|
|
94
|
+
We send three metrics:
|
|
95
|
+
|
|
96
|
+
- **Largest Contentful Paint (LCP)**: measures loading performance. To provide a good user experience, LCP should occur within 2.5 seconds of when the page first starts loading.
|
|
97
|
+
- **First Input Delay (FID)**: measures interactivity. To provide a good user experience, pages should have a FID of 100 milliseconds or less.
|
|
98
|
+
- **Cumulative Layout Shift (CLS)**: measures visual stability. To provide a good user experience, pages should maintain a CLS of 0.1. or less.
|
|
99
|
+
|
|
100
|
+
#### Note
|
|
101
|
+
|
|
102
|
+
Out of the box this plugin will simply load Google Tag Manager on the initial page/app load. It's up to you to fire tags based on changes in your app. See the above "Tracking routes" section for an example.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
const listOfMetricsSend = new Set();
|
|
2
|
+
|
|
3
|
+
const debounce = (fn, timeout) => {
|
|
4
|
+
let timer = null;
|
|
5
|
+
|
|
6
|
+
return (...args) => {
|
|
7
|
+
if (timer) {
|
|
8
|
+
clearTimeout(timer);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
timer = setTimeout(fn, timeout, ...args);
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const sendWebVitals = (dataLayerName = "dataLayer") => {
|
|
16
|
+
const win = window;
|
|
17
|
+
|
|
18
|
+
const sendData = (data) => {
|
|
19
|
+
if (listOfMetricsSend.has(data.name)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
listOfMetricsSend.add(data.name);
|
|
23
|
+
|
|
24
|
+
sendToGTM(data, win[dataLayerName]);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return import("web-vitals/base").then(({ getLCP, getFID, getCLS }) => {
|
|
28
|
+
const debouncedCLS = debounce(sendData, 3000);
|
|
29
|
+
// we don't need to debounce FID - we send it when it happens
|
|
30
|
+
const debouncedFID = sendData;
|
|
31
|
+
// LCP can occur multiple times so we debounce it
|
|
32
|
+
const debouncedLCP = debounce(sendData, 3000);
|
|
33
|
+
|
|
34
|
+
// With the true flag, we measure all previous occurrences too, in case we start listening too late.
|
|
35
|
+
getCLS(debouncedCLS, true);
|
|
36
|
+
getFID(debouncedFID, true);
|
|
37
|
+
getLCP(debouncedLCP, true);
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const sendToGTM = ({ name, value, id }, dataLayer) => {
|
|
42
|
+
// Log warning and return if dataLayer is undefined
|
|
43
|
+
if (!dataLayer) {
|
|
44
|
+
console.log("GTM dataLayer is undefined. Consent granted?");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
dataLayer.push({
|
|
49
|
+
event: "core-web-vitals",
|
|
50
|
+
webVitalsMeasurement: {
|
|
51
|
+
name: name,
|
|
52
|
+
// The `id` value will be unique to the current page load. When sending
|
|
53
|
+
// multiple values from the same page (e.g. for CLS), Google Analytics can
|
|
54
|
+
// compute a total by grouping on this ID (note: requires `eventLabel` to
|
|
55
|
+
// be a dimension in your report).
|
|
56
|
+
id,
|
|
57
|
+
// Google Analytics metrics must be integers, so the value is rounded.
|
|
58
|
+
// For CLS the value is first multiplied by 1000 for greater precision
|
|
59
|
+
// (note: increase the multiplier for greater precision if needed).
|
|
60
|
+
value: Math.round(name === "CLS" ? value * 1000 : value)
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const onRouteUpdate = (_, pluginOptions) => {
|
|
66
|
+
if (
|
|
67
|
+
process.env.NODE_ENV === "production" ||
|
|
68
|
+
pluginOptions.includeInDevelopment
|
|
69
|
+
) {
|
|
70
|
+
// wrap inside a timeout to ensure the title has properly been changed
|
|
71
|
+
setTimeout(() => {
|
|
72
|
+
const data = pluginOptions.dataLayerName
|
|
73
|
+
? window[pluginOptions.dataLayerName]
|
|
74
|
+
: window.dataLayer;
|
|
75
|
+
|
|
76
|
+
// Log warning and return if dataLayer is undefined
|
|
77
|
+
if (!data) {
|
|
78
|
+
console.log("GTM dataLayer is undefined. Consent granted?");
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const eventName = pluginOptions.routeChangeEventName
|
|
83
|
+
? pluginOptions.routeChangeEventName
|
|
84
|
+
: "gatsby-route-change";
|
|
85
|
+
|
|
86
|
+
data.push({ event: eventName });
|
|
87
|
+
}, 50);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const onInitialClientRender = (_, pluginOptions) => {
|
|
92
|
+
// we only load the polyfill in production so we can't enable it in development
|
|
93
|
+
if (
|
|
94
|
+
process.env.NODE_ENV === "production" &&
|
|
95
|
+
pluginOptions.enableWebVitalsTracking
|
|
96
|
+
) {
|
|
97
|
+
sendWebVitals(pluginOptions.dataLayerName);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** @type {import('gatsby').GatsbyNode["onPreInit"]} */
|
|
2
|
+
exports.onPreInit = (args, options) => {
|
|
3
|
+
if (options.defaultDataLayer) {
|
|
4
|
+
options.defaultDataLayer = {
|
|
5
|
+
type: typeof options.defaultDataLayer,
|
|
6
|
+
value: options.defaultDataLayer
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
if (options.defaultDataLayer.type === "function") {
|
|
10
|
+
options.defaultDataLayer.value = options.defaultDataLayer.value.toString()
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.pluginOptionsSchema = ({ Joi }) =>
|
|
16
|
+
Joi.object({
|
|
17
|
+
id: Joi.string().description(
|
|
18
|
+
"Google Tag Manager ID that can be found in your Tag Manager dashboard."
|
|
19
|
+
),
|
|
20
|
+
includeInDevelopment: Joi.boolean()
|
|
21
|
+
.default(false)
|
|
22
|
+
.description(
|
|
23
|
+
"Include Google Tag Manager when running in development mode."
|
|
24
|
+
),
|
|
25
|
+
defaultDataLayer: Joi.alternatives()
|
|
26
|
+
.try(Joi.object(), Joi.function())
|
|
27
|
+
.default(null)
|
|
28
|
+
.description(
|
|
29
|
+
"Data layer to be set before Google Tag Manager is loaded. Should be an object or a function."
|
|
30
|
+
),
|
|
31
|
+
gtmAuth: Joi.string().description(
|
|
32
|
+
"Google Tag Manager environment auth string."
|
|
33
|
+
),
|
|
34
|
+
gtmPreview: Joi.string().description(
|
|
35
|
+
"Google Tag Manager environment preview name."
|
|
36
|
+
),
|
|
37
|
+
dataLayerName: Joi.string().description("Data layer name."),
|
|
38
|
+
routeChangeEventName: Joi.string()
|
|
39
|
+
.default("gatsby-route-change")
|
|
40
|
+
.description(
|
|
41
|
+
"Name of the event that is triggered on every Gatsby route change."
|
|
42
|
+
),
|
|
43
|
+
enableWebVitalsTracking: Joi.boolean().default(false),
|
|
44
|
+
selfHostedOrigin: Joi.string()
|
|
45
|
+
.default("https://www.googletagmanager.com")
|
|
46
|
+
.description("The origin where GTM is hosted."),
|
|
47
|
+
selfHostedPath: Joi.string()
|
|
48
|
+
.default("gtm.js")
|
|
49
|
+
.description("The path where GTM is hosted."),
|
|
50
|
+
deferLoading: Joi.boolean()
|
|
51
|
+
.default(false)
|
|
52
|
+
.description("Defer loading of Google Tag Manager script until consent is given.")
|
|
53
|
+
})
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { oneLine, stripIndent } from "common-tags";
|
|
3
|
+
|
|
4
|
+
const generateGTM = ({
|
|
5
|
+
id,
|
|
6
|
+
environmentParamStr,
|
|
7
|
+
dataLayerName,
|
|
8
|
+
selfHostedOrigin,
|
|
9
|
+
selfHostedPath,
|
|
10
|
+
}) => stripIndent`
|
|
11
|
+
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
12
|
+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
13
|
+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
14
|
+
'${selfHostedOrigin}/${selfHostedPath}?id='+i+dl+'${environmentParamStr}';f.parentNode.insertBefore(j,f);
|
|
15
|
+
})(window,document,'script','${dataLayerName}', '${id}');`;
|
|
16
|
+
|
|
17
|
+
const generateGTMIframe = ({ id, environmentParamStr, selfHostedOrigin, deferLoading }) => {
|
|
18
|
+
const iframeSrc = deferLoading ? `data-src` : `src`;
|
|
19
|
+
return oneLine`<iframe ${iframeSrc}="${selfHostedOrigin}/ns.html?id=${id}${environmentParamStr}" data-name="google-tag-manager" height="0" width="0" style="display: none; visibility: hidden" aria-hidden="true"></iframe>`;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const generateDefaultDataLayer = (dataLayer, reporter, dataLayerName) => {
|
|
23
|
+
let result = `window.${dataLayerName} = window.${dataLayerName} || [];`
|
|
24
|
+
|
|
25
|
+
if (dataLayer.type === "function") {
|
|
26
|
+
result += `window.${dataLayerName}.push((${dataLayer.value})());`
|
|
27
|
+
} else {
|
|
28
|
+
if (dataLayer.type !== "object" || dataLayer.value.constructor !== Object) {
|
|
29
|
+
reporter.panic(
|
|
30
|
+
`Oops the plugin option "defaultDataLayer" should be a plain object. "${dataLayer}" is not valid.`
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
result += `window.${dataLayerName}.push(${JSON.stringify(
|
|
35
|
+
dataLayer.value
|
|
36
|
+
)});`
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return stripIndent`${result}`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const onRenderBody = (
|
|
43
|
+
{ setHeadComponents, setPreBodyComponents, reporter },
|
|
44
|
+
{
|
|
45
|
+
id,
|
|
46
|
+
includeInDevelopment = false,
|
|
47
|
+
gtmAuth,
|
|
48
|
+
gtmPreview,
|
|
49
|
+
defaultDataLayer,
|
|
50
|
+
dataLayerName = "dataLayer",
|
|
51
|
+
enableWebVitalsTracking = false,
|
|
52
|
+
selfHostedOrigin = "https://www.googletagmanager.com",
|
|
53
|
+
selfHostedPath = "gtm.js",
|
|
54
|
+
deferLoading = false
|
|
55
|
+
}
|
|
56
|
+
) => {
|
|
57
|
+
if (process.env.NODE_ENV === "production" || includeInDevelopment) {
|
|
58
|
+
const environmentParamStr =
|
|
59
|
+
gtmAuth && gtmPreview
|
|
60
|
+
? oneLine`>m_auth=${gtmAuth}>m_preview=${gtmPreview}>m_cookies_win=x`
|
|
61
|
+
: "";
|
|
62
|
+
|
|
63
|
+
let defaultDataLayerCode = "";
|
|
64
|
+
if (defaultDataLayer) {
|
|
65
|
+
defaultDataLayerCode = generateDefaultDataLayer(
|
|
66
|
+
defaultDataLayer,
|
|
67
|
+
reporter,
|
|
68
|
+
dataLayerName
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
selfHostedOrigin = selfHostedOrigin.replace(/\/$/, "");
|
|
73
|
+
|
|
74
|
+
const inlineScripts = [];
|
|
75
|
+
if (enableWebVitalsTracking) {
|
|
76
|
+
// web-vitals/polyfill (necessary for non chromium browsers)
|
|
77
|
+
// @seehttps://www.npmjs.com/package/web-vitals#how-the-polyfill-works
|
|
78
|
+
inlineScripts.push(
|
|
79
|
+
<script
|
|
80
|
+
key={"gatsby-plugin-google-tagmanager-web-vitals"}
|
|
81
|
+
data-gatsby="web-vitals-polyfill"
|
|
82
|
+
dangerouslySetInnerHTML={{
|
|
83
|
+
__html: `
|
|
84
|
+
!function(){var e,t,n,i,r={passive:!0,capture:!0},a=new Date,o=function(){i=[],t=-1,e=null,f(addEventListener)},c=function(i,r){e||(e=r,t=i,n=new Date,f(removeEventListener),u())},u=function(){if(t>=0&&t<n-a){var r={entryType:"first-input",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};i.forEach((function(e){e(r)})),i=[]}},s=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){c(e,t),a()},i=function(){a()},a=function(){removeEventListener("pointerup",n,r),removeEventListener("pointercancel",i,r)};addEventListener("pointerup",n,r),addEventListener("pointercancel",i,r)}(t,e):c(t,e)}},f=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,s,r)}))},p="hidden"===document.visibilityState?0:1/0;addEventListener("visibilitychange",(function e(t){"hidden"===document.visibilityState&&(p=t.timeStamp,removeEventListener("visibilitychange",e,!0))}),!0);o(),self.webVitals={firstInputPolyfill:function(e){i.push(e),u()},resetFirstInputPolyfill:o,get firstHiddenTime(){return p}}}();
|
|
85
|
+
`
|
|
86
|
+
}}
|
|
87
|
+
/>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const scriptType = deferLoading ? { type: "text/plain", "data-type": "application/javascript" } : { type: "application/javascript" };
|
|
92
|
+
inlineScripts.push(
|
|
93
|
+
<script
|
|
94
|
+
key="plugin-google-tagmanager"
|
|
95
|
+
{...scriptType}
|
|
96
|
+
data-name="google-tag-manager"
|
|
97
|
+
dangerouslySetInnerHTML={{
|
|
98
|
+
__html: oneLine`
|
|
99
|
+
${defaultDataLayerCode}
|
|
100
|
+
${generateGTM({
|
|
101
|
+
id,
|
|
102
|
+
environmentParamStr,
|
|
103
|
+
dataLayerName,
|
|
104
|
+
selfHostedOrigin,
|
|
105
|
+
selfHostedPath
|
|
106
|
+
})}`
|
|
107
|
+
}}
|
|
108
|
+
/>
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
setHeadComponents(inlineScripts);
|
|
112
|
+
|
|
113
|
+
setPreBodyComponents([
|
|
114
|
+
<noscript
|
|
115
|
+
key="plugin-google-tagmanager"
|
|
116
|
+
dangerouslySetInnerHTML={{
|
|
117
|
+
__html: generateGTMIframe({
|
|
118
|
+
id,
|
|
119
|
+
environmentParamStr,
|
|
120
|
+
selfHostedOrigin,
|
|
121
|
+
deferLoading
|
|
122
|
+
})
|
|
123
|
+
}}
|
|
124
|
+
/>
|
|
125
|
+
]);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// noop
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gatsby-plugin-google-tagmanager",
|
|
3
|
+
"description": "Gatsby plugin to add google tagmanager onto a site",
|
|
4
|
+
"version": "5.13.1",
|
|
5
|
+
"author": "Thijs Koerselman <thijs@vauxlab.com>",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/gatsbyjs/gatsby/issues"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@babel/runtime": "^7.20.13",
|
|
11
|
+
"web-vitals": "^1.1.2"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@babel/cli": "^7.20.7",
|
|
15
|
+
"@babel/core": "^7.20.12",
|
|
16
|
+
"babel-preset-gatsby-package": "^3.13.1",
|
|
17
|
+
"cross-env": "^7.0.3",
|
|
18
|
+
"gatsby-plugin-utils": "^4.13.1"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-tagmanager#readme",
|
|
21
|
+
"keywords": [
|
|
22
|
+
"gatsby",
|
|
23
|
+
"gatsby-plugin",
|
|
24
|
+
"google analytics",
|
|
25
|
+
"google tagmanager"
|
|
26
|
+
],
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"main": "index.js",
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"gatsby": "^5.0.0-next",
|
|
31
|
+
"react": "^18.0.0 || ^0.0.0",
|
|
32
|
+
"react-dom": "^18.0.0 || ^0.0.0"
|
|
33
|
+
},
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/gatsbyjs/gatsby.git",
|
|
37
|
+
"directory": "packages/gatsby-plugin-google-tagmanager"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "babel src --out-dir . --ignore \"**/__tests__\"",
|
|
41
|
+
"prepare": "cross-env NODE_ENV=production npm run build",
|
|
42
|
+
"watch": "babel -w src --out-dir . --ignore \"**/__tests__\""
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=18.0.0"
|
|
46
|
+
},
|
|
47
|
+
"gitHead": "b24134df49cf5fb509c3fba4310a0a71a952a35b"
|
|
48
|
+
}
|
|
@@ -20,18 +20,18 @@ const invitationsRejectPage = {
|
|
|
20
20
|
required: false,
|
|
21
21
|
default: "Invitation not found."
|
|
22
22
|
}),
|
|
23
|
-
stringField({
|
|
24
|
-
label: "Rejected text",
|
|
25
|
-
name: "rejectedText",
|
|
26
|
-
required: false,
|
|
27
|
-
default: "Invitation has already been rejected."
|
|
28
|
-
}),
|
|
29
23
|
stringField({
|
|
30
24
|
label: "Reject text",
|
|
31
25
|
name: "rejectText",
|
|
32
26
|
required: false,
|
|
33
27
|
default: "To reject please click on the button below."
|
|
34
28
|
}),
|
|
29
|
+
stringField({
|
|
30
|
+
label: "Reject Confirmation Text",
|
|
31
|
+
name: "rejectedText",
|
|
32
|
+
required: false,
|
|
33
|
+
default: "Invitation has already been rejected."
|
|
34
|
+
}),
|
|
35
35
|
stringField({
|
|
36
36
|
label: "Reject CTA label",
|
|
37
37
|
name: "rejectCTALabel",
|
|
@@ -17,16 +17,15 @@ import {
|
|
|
17
17
|
SUMMIT_ID,
|
|
18
18
|
SUPABASE_URL,
|
|
19
19
|
SUPABASE_KEY,
|
|
20
|
-
} from "
|
|
21
|
-
import { PHASES } from "
|
|
20
|
+
} from "@utils/envVariables";
|
|
21
|
+
import { PHASES } from "@utils/phasesUtils";
|
|
22
22
|
|
|
23
23
|
import "attendee-to-attendee-widget/dist/index.css";
|
|
24
24
|
|
|
25
25
|
import { SentryFallbackFunction } from "./SentryErrorComponent";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} from "../utils/customEvents";
|
|
26
|
+
|
|
27
|
+
import { useEventListener } from "@utils/hooks";
|
|
28
|
+
import { INIT_LOGOUT_EVENT } from "@utils/eventTriggers";
|
|
30
29
|
|
|
31
30
|
const sbAuthProps = {
|
|
32
31
|
supabaseUrl: getEnvVariable(SUPABASE_URL),
|
|
@@ -192,9 +191,9 @@ const AccessTracker = ({ user, isLoggedUser, summitPhase, chatSettings }) => {
|
|
|
192
191
|
const handleLogout = useCallback(() => {
|
|
193
192
|
if (trackerRef.current)
|
|
194
193
|
trackerRef.current.signOut();
|
|
195
|
-
},[]);
|
|
194
|
+
}, []);
|
|
196
195
|
|
|
197
|
-
|
|
196
|
+
useEventListener(INIT_LOGOUT_EVENT, handleLogout);
|
|
198
197
|
|
|
199
198
|
useEffect(() => {
|
|
200
199
|
if (!isLoggedUser) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
2
3
|
import FooterMarketing from "../FooterMarketing";
|
|
3
4
|
import Link from "../Link";
|
|
4
5
|
|
|
@@ -29,7 +30,7 @@ const FooterTemplate = ({ data, summit, marketing }) => {
|
|
|
29
30
|
{data.social.networks.map((net, index) => (
|
|
30
31
|
net.display &&
|
|
31
32
|
<Link to={net.link} key={index}>
|
|
32
|
-
<
|
|
33
|
+
<FontAwesomeIcon icon={`fa-brands ${net.icon}`} size="lg" />
|
|
33
34
|
</Link>
|
|
34
35
|
))}
|
|
35
36
|
</div>
|
|
@@ -81,7 +82,7 @@ const FooterTemplate = ({ data, summit, marketing }) => {
|
|
|
81
82
|
{data.social.networks.map((net, index) => (
|
|
82
83
|
net.display &&
|
|
83
84
|
<Link to={net.link} className={styles.link} key={index}>
|
|
84
|
-
<
|
|
85
|
+
<FontAwesomeIcon icon={`fa-brands ${net.icon}`} size="lg" />
|
|
85
86
|
</Link>
|
|
86
87
|
))}
|
|
87
88
|
</div>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { navigate } from "gatsby"
|
|
3
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { navigate } from "gatsby";
|
|
3
|
+
import { triggerLogoutEvent } from "@utils/eventTriggers";
|
|
4
4
|
|
|
5
5
|
export default class
|
|
6
6
|
LogoutButton extends React.Component {
|
|
7
7
|
|
|
8
8
|
onClickLogout() {
|
|
9
|
-
|
|
10
|
-
navigate(
|
|
9
|
+
triggerLogoutEvent();
|
|
10
|
+
navigate("/auth/logout", {
|
|
11
11
|
state: {
|
|
12
12
|
backUrl: window.location.pathname
|
|
13
13
|
}
|
|
@@ -19,10 +19,9 @@ export default class
|
|
|
19
19
|
|
|
20
20
|
if (isLoggedUser) {
|
|
21
21
|
return (
|
|
22
|
-
|
|
23
22
|
<div className={styles.buttons}>
|
|
24
23
|
<button className={`link ${styles.userIcon}`} title="Logout" onClick={() => this.onClickLogout()}>
|
|
25
|
-
<i className="fa fa-sign-out icon is-medium" style={{fontSize:
|
|
24
|
+
<i className="fa fa-sign-out icon is-medium" style={{ fontSize: "1.5rem" }} />
|
|
26
25
|
</button>
|
|
27
26
|
</div>
|
|
28
27
|
);
|
|
@@ -22,7 +22,7 @@ const ImagesColumn = ({ images }) => {
|
|
|
22
22
|
<img
|
|
23
23
|
key={index}
|
|
24
24
|
src={getSrc(image.src)}
|
|
25
|
-
alt={image.alt}
|
|
25
|
+
alt={image.alt ?? ""}
|
|
26
26
|
/>
|
|
27
27
|
))}
|
|
28
28
|
</Slider>
|
|
@@ -30,7 +30,7 @@ const ImagesColumn = ({ images }) => {
|
|
|
30
30
|
<GatsbyImage
|
|
31
31
|
className={styles.singleImage}
|
|
32
32
|
image={getImage(images[0].src)}
|
|
33
|
-
alt={images[0].alt}
|
|
33
|
+
alt={images[0].alt ?? ""}
|
|
34
34
|
/>
|
|
35
35
|
)}
|
|
36
36
|
</div>
|
|
@@ -21,14 +21,12 @@ import { SentryFallbackFunction } from "./SentryErrorComponent";
|
|
|
21
21
|
// these two libraries are client-side only
|
|
22
22
|
import RegistrationLiteWidget from "summit-registration-lite/dist";
|
|
23
23
|
import "summit-registration-lite/dist/index.css";
|
|
24
|
-
|
|
25
24
|
import useSiteSettings from "@utils/useSiteSettings";
|
|
26
25
|
import useMarketingSettings, { MARKETING_SETTINGS_KEYS } from "@utils/useMarketingSettings";
|
|
27
26
|
import { getEnvVariable, SUMMIT_API_BASE_URL, OAUTH2_CLIENT_ID, REGISTRATION_BASE_URL, SUPPORT_EMAIL } from "@utils/envVariables";
|
|
28
27
|
import { userHasAccessLevel, VirtualAccessLevel } from "@utils/authorizedGroups";
|
|
29
28
|
import { validateIdentityProviderButtons } from "@utils/loginUtils";
|
|
30
|
-
import {
|
|
31
|
-
import { PURCHASE_COMPLETE } from "@utils/analytics/events";
|
|
29
|
+
import { triggerTagManagerTrackEvent } from "@utils/eventTriggers";
|
|
32
30
|
|
|
33
31
|
const RegistrationLiteComponent = ({
|
|
34
32
|
registrationProfile,
|
|
@@ -161,10 +159,10 @@ const RegistrationLiteComponent = ({
|
|
|
161
159
|
return checkRequireExtraQuestionsByAttendee(attendee);
|
|
162
160
|
},
|
|
163
161
|
onPurchaseComplete: (order) => {
|
|
164
|
-
triggerAnalyticsTrackEvent(PURCHASE_COMPLETE, { order });
|
|
165
162
|
// check if it"s necessary to update profile
|
|
166
163
|
setUserOrder(order).then(()=> checkOrderData(order));
|
|
167
164
|
},
|
|
165
|
+
trackEvent: triggerTagManagerTrackEvent,
|
|
168
166
|
inPersonDisclaimer: inPersonDisclaimer,
|
|
169
167
|
handleCompanyError: () => handleCompanyError,
|
|
170
168
|
allowsNativeAuth: allowsNativeAuth,
|
package/src/components/Seo.js
CHANGED
|
@@ -2,7 +2,6 @@ import * as React from "react";
|
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import useSiteMetadata from "@utils/useSiteMetadata";
|
|
4
4
|
import useSiteSettings from "@utils/useSiteSettings";
|
|
5
|
-
import { getSrc } from "gatsby-plugin-image";
|
|
6
5
|
import { buildUrl } from "@utils/urlFormating";
|
|
7
6
|
import { getEnvVariable, SITE_URL } from "@utils/envVariables";
|
|
8
7
|
|
|
@@ -13,7 +12,7 @@ const Seo = ({ title, description, location, children }) => {
|
|
|
13
12
|
} = useSiteMetadata();
|
|
14
13
|
|
|
15
14
|
const siteSettings = useSiteSettings();
|
|
16
|
-
const image = siteSettings?.siteMetadata?.image
|
|
15
|
+
const image = siteSettings?.siteMetadata?.image;
|
|
17
16
|
|
|
18
17
|
const siteUrl = getEnvVariable(SITE_URL);
|
|
19
18
|
const siteUrlInfo = siteUrl ? new URL(siteUrl) : null;
|
|
@@ -25,8 +24,9 @@ const Seo = ({ title, description, location, children }) => {
|
|
|
25
24
|
title: title ? `${siteTitle} - ${title}` : siteTitle,
|
|
26
25
|
description: description || defaultDescription,
|
|
27
26
|
url: buildUrl(scheme, host, pathname),
|
|
28
|
-
image: host && image ? buildUrl(scheme, host,
|
|
27
|
+
image: host && image ? buildUrl(scheme, host, image.publicURL) : null,
|
|
29
28
|
};
|
|
29
|
+
|
|
30
30
|
return (
|
|
31
31
|
<>
|
|
32
32
|
{seo.title && <title>{seo.title}</title>}
|