@gem-sdk/pages 1.12.0-staging-66146a03 → 1.12.0-staging-101c3f37
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/dist/cjs/components/FacebookPixel.js +2 -3
- package/dist/cjs/components/GoogleAnalytic.js +10 -6
- package/dist/cjs/components/TikTokPixel.js +1 -1
- package/dist/cjs/libs/api/get-builder-props.js +1 -0
- package/dist/cjs/libs/api/get-home-page-props-v2.js +1 -0
- package/dist/cjs/libs/api/get-home-page-props.js +1 -0
- package/dist/cjs/libs/api/get-static-page-props-preview.js +1 -0
- package/dist/cjs/libs/api/get-static-page-props-v2.js +1 -0
- package/dist/cjs/libs/api/get-static-page-props.js +1 -0
- package/dist/esm/components/FacebookPixel.js +2 -3
- package/dist/esm/components/GoogleAnalytic.js +10 -6
- package/dist/esm/components/TikTokPixel.js +1 -1
- package/dist/esm/libs/api/get-builder-props.js +1 -0
- package/dist/esm/libs/api/get-home-page-props-v2.js +1 -0
- package/dist/esm/libs/api/get-home-page-props.js +1 -0
- package/dist/esm/libs/api/get-static-page-props-preview.js +1 -0
- package/dist/esm/libs/api/get-static-page-props-v2.js +1 -0
- package/dist/esm/libs/api/get-static-page-props.js +1 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +2 -2
|
@@ -9,8 +9,6 @@ var react = require('react');
|
|
|
9
9
|
const FacebookPixel = ({ pixelId })=>{
|
|
10
10
|
const router$1 = router.useRouter();
|
|
11
11
|
react.useEffect(()=>{
|
|
12
|
-
// This pageview only triggers the first time (it's important for Pixel to have real information)
|
|
13
|
-
core.fpixel.pageview();
|
|
14
12
|
const handleRouteChange = ()=>{
|
|
15
13
|
core.fpixel.pageview();
|
|
16
14
|
};
|
|
@@ -26,7 +24,7 @@ const FacebookPixel = ({ pixelId })=>{
|
|
|
26
24
|
if (!pixelId) return null;
|
|
27
25
|
return /*#__PURE__*/ jsxRuntime.jsx(Script, {
|
|
28
26
|
id: "fb-pixel",
|
|
29
|
-
strategy: "
|
|
27
|
+
strategy: "lazyOnload",
|
|
30
28
|
dangerouslySetInnerHTML: {
|
|
31
29
|
__html: `
|
|
32
30
|
!function(f,b,e,v,n,t,s)
|
|
@@ -38,6 +36,7 @@ const FacebookPixel = ({ pixelId })=>{
|
|
|
38
36
|
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
|
39
37
|
'https://connect.facebook.net/en_US/fbevents.js');
|
|
40
38
|
fbq('init', ${pixelId});
|
|
39
|
+
fbq('track', 'PageView');
|
|
41
40
|
`
|
|
42
41
|
}
|
|
43
42
|
});
|
|
@@ -22,17 +22,20 @@ const GoogleAnalytic = ({ trackingId })=>{
|
|
|
22
22
|
trackingId,
|
|
23
23
|
router$1.events
|
|
24
24
|
]);
|
|
25
|
+
const handleOnReady = ()=>{
|
|
26
|
+
core.gtag.pageview(router$1.pathname, trackingId);
|
|
27
|
+
};
|
|
25
28
|
if (!trackingId) return null;
|
|
26
29
|
if (trackingId.startsWith('UA-')) return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
27
30
|
children: [
|
|
28
31
|
/*#__PURE__*/ jsxRuntime.jsx(Script, {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
strategy: "lazyOnload",
|
|
33
|
+
onReady: handleOnReady,
|
|
34
|
+
src: "https://www.google-analytics.com/analytics.js"
|
|
32
35
|
}),
|
|
33
36
|
/*#__PURE__*/ jsxRuntime.jsx(Script, {
|
|
34
|
-
strategy: "afterInteractive",
|
|
35
37
|
id: "google-analytics",
|
|
38
|
+
strategy: "lazyOnload",
|
|
36
39
|
dangerouslySetInnerHTML: {
|
|
37
40
|
__html: `window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
|
38
41
|
ga('create', '${trackingId}', 'auto');
|
|
@@ -46,12 +49,13 @@ const GoogleAnalytic = ({ trackingId })=>{
|
|
|
46
49
|
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
47
50
|
children: [
|
|
48
51
|
/*#__PURE__*/ jsxRuntime.jsx(Script, {
|
|
49
|
-
strategy: "
|
|
52
|
+
strategy: "lazyOnload",
|
|
53
|
+
onReady: handleOnReady,
|
|
50
54
|
src: `https://www.googletagmanager.com/gtag/js?id=${trackingId}`
|
|
51
55
|
}),
|
|
52
56
|
/*#__PURE__*/ jsxRuntime.jsx(Script, {
|
|
53
57
|
id: "gtag-init",
|
|
54
|
-
strategy: "
|
|
58
|
+
strategy: "lazyOnload",
|
|
55
59
|
dangerouslySetInnerHTML: {
|
|
56
60
|
__html: `
|
|
57
61
|
window.dataLayer = window.dataLayer || [];
|
|
@@ -25,6 +25,7 @@ const getBuilderProps = async (fetcher, shopifyFetcher)=>{
|
|
|
25
25
|
const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
|
|
26
26
|
const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
|
|
27
27
|
return parseJson.serializableJson({
|
|
28
|
+
moneyFormat: shopMeta?.shop.moneyFormat ?? null,
|
|
28
29
|
currency: shopMeta?.localization.country.currency.isoCode ?? null,
|
|
29
30
|
languageIsoCode,
|
|
30
31
|
countryIsoCode,
|
|
@@ -119,6 +119,7 @@ const getHomePagePropsV2 = (fetcher, shopifyFetcher)=>async ()=>{
|
|
|
119
119
|
swr: {
|
|
120
120
|
fallback
|
|
121
121
|
},
|
|
122
|
+
moneyFormat: shopMeta?.shop.moneyFormat ?? null,
|
|
122
123
|
currency: shopMeta?.localization.country.currency.isoCode ?? null,
|
|
123
124
|
languageIsoCode,
|
|
124
125
|
countryIsoCode,
|
|
@@ -122,6 +122,7 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
122
122
|
fontStyle,
|
|
123
123
|
builderData: pageTemplate,
|
|
124
124
|
pageType,
|
|
125
|
+
moneyFormat: shopMeta?.shop.moneyFormat ?? null,
|
|
125
126
|
currency: shopMeta?.localization.country.currency.isoCode ?? null,
|
|
126
127
|
languageIsoCode,
|
|
127
128
|
countryIsoCode,
|
|
@@ -119,6 +119,7 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
119
119
|
fontStyle,
|
|
120
120
|
builderData: pageTemplate,
|
|
121
121
|
pageType,
|
|
122
|
+
moneyFormat: shopMeta?.shop.moneyFormat ?? null,
|
|
122
123
|
currency: shopMeta?.localization.country.currency.isoCode ?? null,
|
|
123
124
|
languageIsoCode,
|
|
124
125
|
countryIsoCode,
|
|
@@ -132,6 +132,7 @@ const getStaticPageProps = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
132
132
|
fontStyle,
|
|
133
133
|
builderData: pageTemplate,
|
|
134
134
|
pageType,
|
|
135
|
+
moneyFormat: shopMeta?.shop.moneyFormat ?? null,
|
|
135
136
|
currency: shopMeta?.localization.country.currency.isoCode ?? null,
|
|
136
137
|
languageIsoCode,
|
|
137
138
|
countryIsoCode,
|
|
@@ -7,8 +7,6 @@ import { useEffect } from 'react';
|
|
|
7
7
|
const FacebookPixel = ({ pixelId })=>{
|
|
8
8
|
const router = useRouter();
|
|
9
9
|
useEffect(()=>{
|
|
10
|
-
// This pageview only triggers the first time (it's important for Pixel to have real information)
|
|
11
|
-
fpixel.pageview();
|
|
12
10
|
const handleRouteChange = ()=>{
|
|
13
11
|
fpixel.pageview();
|
|
14
12
|
};
|
|
@@ -24,7 +22,7 @@ const FacebookPixel = ({ pixelId })=>{
|
|
|
24
22
|
if (!pixelId) return null;
|
|
25
23
|
return /*#__PURE__*/ jsx(Script, {
|
|
26
24
|
id: "fb-pixel",
|
|
27
|
-
strategy: "
|
|
25
|
+
strategy: "lazyOnload",
|
|
28
26
|
dangerouslySetInnerHTML: {
|
|
29
27
|
__html: `
|
|
30
28
|
!function(f,b,e,v,n,t,s)
|
|
@@ -36,6 +34,7 @@ const FacebookPixel = ({ pixelId })=>{
|
|
|
36
34
|
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
|
37
35
|
'https://connect.facebook.net/en_US/fbevents.js');
|
|
38
36
|
fbq('init', ${pixelId});
|
|
37
|
+
fbq('track', 'PageView');
|
|
39
38
|
`
|
|
40
39
|
}
|
|
41
40
|
});
|
|
@@ -20,17 +20,20 @@ const GoogleAnalytic = ({ trackingId })=>{
|
|
|
20
20
|
trackingId,
|
|
21
21
|
router.events
|
|
22
22
|
]);
|
|
23
|
+
const handleOnReady = ()=>{
|
|
24
|
+
gtag.pageview(router.pathname, trackingId);
|
|
25
|
+
};
|
|
23
26
|
if (!trackingId) return null;
|
|
24
27
|
if (trackingId.startsWith('UA-')) return /*#__PURE__*/ jsxs(Fragment, {
|
|
25
28
|
children: [
|
|
26
29
|
/*#__PURE__*/ jsx(Script, {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
strategy: "lazyOnload",
|
|
31
|
+
onReady: handleOnReady,
|
|
32
|
+
src: "https://www.google-analytics.com/analytics.js"
|
|
30
33
|
}),
|
|
31
34
|
/*#__PURE__*/ jsx(Script, {
|
|
32
|
-
strategy: "afterInteractive",
|
|
33
35
|
id: "google-analytics",
|
|
36
|
+
strategy: "lazyOnload",
|
|
34
37
|
dangerouslySetInnerHTML: {
|
|
35
38
|
__html: `window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
|
36
39
|
ga('create', '${trackingId}', 'auto');
|
|
@@ -44,12 +47,13 @@ const GoogleAnalytic = ({ trackingId })=>{
|
|
|
44
47
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
45
48
|
children: [
|
|
46
49
|
/*#__PURE__*/ jsx(Script, {
|
|
47
|
-
strategy: "
|
|
50
|
+
strategy: "lazyOnload",
|
|
51
|
+
onReady: handleOnReady,
|
|
48
52
|
src: `https://www.googletagmanager.com/gtag/js?id=${trackingId}`
|
|
49
53
|
}),
|
|
50
54
|
/*#__PURE__*/ jsx(Script, {
|
|
51
55
|
id: "gtag-init",
|
|
52
|
-
strategy: "
|
|
56
|
+
strategy: "lazyOnload",
|
|
53
57
|
dangerouslySetInnerHTML: {
|
|
54
58
|
__html: `
|
|
55
59
|
window.dataLayer = window.dataLayer || [];
|
|
@@ -23,6 +23,7 @@ const getBuilderProps = async (fetcher, shopifyFetcher)=>{
|
|
|
23
23
|
const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
|
|
24
24
|
const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
|
|
25
25
|
return serializableJson({
|
|
26
|
+
moneyFormat: shopMeta?.shop.moneyFormat ?? null,
|
|
26
27
|
currency: shopMeta?.localization.country.currency.isoCode ?? null,
|
|
27
28
|
languageIsoCode,
|
|
28
29
|
countryIsoCode,
|
|
@@ -117,6 +117,7 @@ const getHomePagePropsV2 = (fetcher, shopifyFetcher)=>async ()=>{
|
|
|
117
117
|
swr: {
|
|
118
118
|
fallback
|
|
119
119
|
},
|
|
120
|
+
moneyFormat: shopMeta?.shop.moneyFormat ?? null,
|
|
120
121
|
currency: shopMeta?.localization.country.currency.isoCode ?? null,
|
|
121
122
|
languageIsoCode,
|
|
122
123
|
countryIsoCode,
|
|
@@ -120,6 +120,7 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
120
120
|
fontStyle,
|
|
121
121
|
builderData: pageTemplate,
|
|
122
122
|
pageType,
|
|
123
|
+
moneyFormat: shopMeta?.shop.moneyFormat ?? null,
|
|
123
124
|
currency: shopMeta?.localization.country.currency.isoCode ?? null,
|
|
124
125
|
languageIsoCode,
|
|
125
126
|
countryIsoCode,
|
|
@@ -117,6 +117,7 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
117
117
|
fontStyle,
|
|
118
118
|
builderData: pageTemplate,
|
|
119
119
|
pageType,
|
|
120
|
+
moneyFormat: shopMeta?.shop.moneyFormat ?? null,
|
|
120
121
|
currency: shopMeta?.localization.country.currency.isoCode ?? null,
|
|
121
122
|
languageIsoCode,
|
|
122
123
|
countryIsoCode,
|
|
@@ -130,6 +130,7 @@ const getStaticPageProps = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
130
130
|
fontStyle,
|
|
131
131
|
builderData: pageTemplate,
|
|
132
132
|
pageType,
|
|
133
|
+
moneyFormat: shopMeta?.shop.moneyFormat ?? null,
|
|
133
134
|
currency: shopMeta?.localization.country.currency.isoCode ?? null,
|
|
134
135
|
languageIsoCode,
|
|
135
136
|
countryIsoCode,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ type PageBuilderProps = {
|
|
|
20
20
|
shopToken?: string | null;
|
|
21
21
|
pageHandle?: string | null;
|
|
22
22
|
currency?: string | null;
|
|
23
|
+
moneyFormat?: string | null;
|
|
24
|
+
moneyWithCurrencyFormat?: string | null;
|
|
23
25
|
locale?: string | null;
|
|
24
26
|
languageIsoCode?: string | null;
|
|
25
27
|
countryIsoCode?: string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "1.12.0-staging-
|
|
3
|
+
"version": "1.12.0-staging-101c3f37",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"next-seo": "^6.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@gem-sdk/core": "1.
|
|
28
|
+
"@gem-sdk/core": "1.12.0-staging-2b439c82",
|
|
29
29
|
"@gem-sdk/plugin-cookie-bar": "1.11.1-staging-66146a03",
|
|
30
30
|
"@gem-sdk/plugin-quick-view": "1.11.1-staging-66146a03",
|
|
31
31
|
"@gem-sdk/plugin-sticky-add-to-cart": "1.11.1-staging-66146a03"
|