rplus-mini-package 1.0.1 → 1.0.2
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/index.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { JSX } from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const GTMTrackerNoScript: ({ gtmInitId, gtmAuth, gtm }: GTMTrackerNoScriptProps) => JSX.Element;
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* NoScript for GA-360 to be placed in <body>
|
|
7
7
|
*/
|
|
8
|
-
declare type
|
|
8
|
+
declare type GTMTrackerNoScriptProps = {
|
|
9
9
|
gtmInitId: string;
|
|
10
10
|
gtmAuth: string;
|
|
11
11
|
gtm: string;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const GTMTrackerScript: ({ pillar, gtmAuth, gtm, gtmId, }: GTMTrackerScriptProps) => JSX.Element;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Script for GA-360 to be placed in <Head>
|
|
18
18
|
*/
|
|
19
|
-
declare type
|
|
19
|
+
declare type GTMTrackerScriptProps = {
|
|
20
20
|
pillar: string;
|
|
21
21
|
gtmAuth: string;
|
|
22
22
|
gtm: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
const s = ({
|
|
3
3
|
pillar: t,
|
|
4
4
|
gtmAuth: e,
|
|
5
5
|
gtm: a,
|
|
6
|
-
gtmId:
|
|
7
|
-
}) => /* @__PURE__ */
|
|
6
|
+
gtmId: i
|
|
7
|
+
}) => /* @__PURE__ */ r(
|
|
8
8
|
"script",
|
|
9
9
|
{
|
|
10
10
|
dangerouslySetInnerHTML: {
|
|
@@ -17,11 +17,11 @@ const s = ({
|
|
|
17
17
|
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
18
18
|
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
19
19
|
'https://www.googletagmanager.com/gtm.js?id='+i+dl+ '>m_auth=${e}>m_preview=${a}>m_cookies_win=x';f.parentNode.insertBefore(j,f);
|
|
20
|
-
})(window,document,'script','dataLayer','${
|
|
20
|
+
})(window,document,'script','dataLayer','${i}');
|
|
21
21
|
`
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
), o = ({ gtmInitId: t, gtmAuth: e, gtm: a }) => /* @__PURE__ */
|
|
24
|
+
), o = ({ gtmInitId: t, gtmAuth: e, gtm: a }) => /* @__PURE__ */ r("noscript", { children: /* @__PURE__ */ r(
|
|
25
25
|
"iframe",
|
|
26
26
|
{
|
|
27
27
|
src: `https://www.googletagmanager.com/ns.html?id=${t}>m_auth=${e}>m_preview=${a}>m_cookies_win=x`,
|
|
@@ -31,6 +31,6 @@ const s = ({
|
|
|
31
31
|
}
|
|
32
32
|
) }, "gtm-noscript");
|
|
33
33
|
export {
|
|
34
|
-
o as
|
|
35
|
-
s as
|
|
34
|
+
o as GTMTrackerNoScript,
|
|
35
|
+
s as GTMTrackerScript
|
|
36
36
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.RplusMiniPackage={},e.jsxRuntime))})(this,(function(e,t){"use strict";const
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.RplusMiniPackage={},e.jsxRuntime))})(this,(function(e,t){"use strict";const a=({pillar:i,gtmAuth:r,gtm:n,gtmId:o})=>t.jsx("script",{dangerouslySetInnerHTML:{__html:`
|
|
2
2
|
window.dataLayer = window.dataLayer || [];
|
|
3
3
|
window.dataLayer.push({
|
|
4
4
|
'pillar' : "${i}"
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
7
7
|
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
8
8
|
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
9
|
-
'https://www.googletagmanager.com/gtm.js?id='+i+dl+ '>m_auth=${
|
|
9
|
+
'https://www.googletagmanager.com/gtm.js?id='+i+dl+ '>m_auth=${r}>m_preview=${n}>m_cookies_win=x';f.parentNode.insertBefore(j,f);
|
|
10
10
|
})(window,document,'script','dataLayer','${o}');
|
|
11
|
-
`}}),
|
|
11
|
+
`}}),s=({gtmInitId:i,gtmAuth:r,gtm:n})=>t.jsx("noscript",{children:t.jsx("iframe",{src:`https://www.googletagmanager.com/ns.html?id=${i}>m_auth=${r}>m_preview=${n}>m_cookies_win=x`,height:"0",width:"0",style:{display:"none",visibility:"hidden"}})},"gtm-noscript");e.GTMTrackerNoScript=s,e.GTMTrackerScript=a,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|