1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3871],{3884:(e,t,s)=>{"use strict";s.r(t),s.d(t,{GoogleAnalytics:()=>w,default:()=>N});var a=s(37876),l=s(24852),n=s(99218),i=s(78239),r=s(48230),o=s.n(r),c=s(7020),d=s(14232),m=s(77281),g=s(32812),x=s(73193);s(62325);var u=s(66637),h=s(81137),p=s(88769),j=s(31531),f=s(64901);let w=()=>{let{academy:e,setAcademy:t,isChatVisible:s}=(0,d.useContext)(n.y2),{setAPIError:r}=(0,d.useContext)(h.C),{l:w}=d.useContext(l.x),[N,v]=(0,d.useState)(""),b=!!((null==e?void 0:e.google_analytics_id)&&(null==e?void 0:e.google_tag_manager_id)),[y,_]=(0,d.useState)(),[X,C]=(0,d.useState)();return(0,d.useEffect)(()=>{e&&v(e.google_analytics_id||"")},[e]),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:`${s?"max-w-screen-lg":"max-w-screen-xl 2xl:max-w-screen-lg"} mx-auto`,children:(0,a.jsxs)(p.A,{styles:"whitespace-nowrap sm:mx-0 mx-4",children:[y?(0,a.jsxs)("p",{className:"bg-red text-white ml-2 pill flex items-center",children:[(0,a.jsx)(m.Qly,{className:"mr-1"}),y]}):(0,a.jsxs)(o(),{href:(0,u.Se)(null==e?void 0:e.url_name)+"/integrations",className:"btn bg-on-primary text-primary flex items-center",children:[(0,a.jsx)(x.kRp,{className:"mr-1"}),w.integrations]}),(0,a.jsx)("div",{className:"ml-auto flex flex-row",children:(0,a.jsx)("button",{onClick:()=>{C(!0);let s=new FormData;s.append("google_analytics_id",function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.trim();if(/^(G-[A-Za-z0-9]+|AW-[A-Za-z0-9]+)$/.test(t))return t;let s=t.match(/id=(G-[A-Za-z0-9]+|AW-[A-Za-z0-9]+)/);return s?s[1]:""}(N)),(0,c.HBN)(e,s,r).then(e=>{e.error||t(e),C(!1)})},disabled:X||!N||!e,className:"btn bg-green text-white ml-2",children:X?(0,a.jsx)(i.A,{className:"fill-white",width:20,height:20}):(0,a.jsxs)("div",{className:"items-center flex",children:[(0,a.jsx)(g.iBF,{className:"inline-block mr-1"}),w.save]})})})]})}),(0,a.jsxs)("div",{className:`${s?"max-w-screen-lg":"max-w-screen-xl 2xl:max-w-screen-lg"} mx-auto px-4 mt-6`,children:[(0,a.jsxs)("div",{className:"flex items-center mb-6",children:[(0,a.jsx)("img",{src:"/assets/integration-google-analytics-logo.jpg",className:"shadow shrink-0 h-20 w-20 rounded bg-light-shade object-cover",alt:"Integration logo"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-lg font-semibold ml-3",children:"Google Analytics 4"}),(0,a.jsx)("p",{className:"ml-3",children:w.integrationGoogleDescription})]})]}),(0,a.jsx)("span",{children:w.integrationGoogleGuide}),b?(0,a.jsxs)("p",{className:"pill bg-rose-100 text-gray-dark mt-4",children:[(0,a.jsx)(j.qNH,{className:"inline-block mr-1 shrink-0 mt-1"}),w.googleTrackingOverlapWarning]}):null,(0,a.jsxs)("div",{className:"flex mt-4",children:[(0,a.jsx)("button",{className:"mr-2 btn text-red btn",onClick:()=>{C(!0);let s=new FormData;s.append("google_analytics_id",""),(0,c.HBN)(e,s,r).then(e=>{e.error||t(e),C(!1)})},children:(0,a.jsx)(f.$Gv,{})}),(null==e?void 0:e.google_analytics_id)?(0,a.jsx)("input",{disabled:!0,value:N,className:"input w-64"}):(0,a.jsx)("textarea",{placeholder:`<!-- Google tag (gtag.js) -->
vendor: 64 bytes, lines 1-2
1 2<script async src='https://www.googletagmanager.com/gtag/js?id=
2G-XXXXXXXXXX
vendor: 12 bytes, line 2
2'></script>
3<script>
vendor: 127 bytes, lines 4-7
4window.dataLayer = window.dataLayer || []; 5function gtag(){dataLayer.push(arguments);} 6gtag('js', new Date()); 7gtag('config', '
7G-XXXXXXXXXX
vendor: 4 bytes, line 7
7');
8</script>`,rows:9,className:"input w-full",value:N,onChange:e=>{v(e.target.value)}})]}),(null==e?void 0:e.google_analytics_id)?(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"font-semibold mt-4",children:[w.integrationStatus,":"]}),(0,a.jsx)("p",{className:"text-green font-semibold text-lg",children:w.googleAnalyticsEnabled})]}):null,(0,a.jsx)("p",{className:"mt-4 mb-1 font-semibold",children:w.information}),(0,a.jsx)("div",{className:"bg-light-shade shadow rounded p-4",children:w.googleAnalyticsInfo})]})]})},N=w},64406:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/[url_name]/integrations/googleanalytics",function(){return s(3884)}])},78239:(e,t,s)=>{"use strict";s.d(t,{$:()=>l,A:()=>n});var a=s(37876);let l=e=>(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",...e,className:e.className,children:[(0,a.jsx)("path",{d:"M31.6 3.5C5.9 13.6-6.6 42.7 3.5 68.4c10.1 25.7 39.2 38.3 64.9 28.1l-3.1-7.9C44 97 19.9 86.6 11.5 65.3c-8.4-21.3 2-45.4 23.3-53.8l-3.2-8z",children:(0,a.jsx)("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",dur:"2s",from:"0 50 50",to:"360 50 50",repeatCount:"indefinite"})}),(0,a.jsx)("path",{d:"M42.3 39.6c5.7-4.3 13.9-3.1 18.1 2.7 4.3 5.7 3.1 13.9-2.7 18.1l4.1 5.5c8.8-6.5 10.6-19 4.1-27.7-6.5-8.8-19-10.6-27.7-4.1l4.1 5.5z",children:(0,a.jsx)("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",dur:"1s",from:"0 50 50",to:"-360 50 50",repeatCount:"indefinite"})}),(0,a.jsx)("path",{d:"M82 35.7C74.1 18 53.4 10.1 35.7 18S10.1 46.6 18 64.3l7.6-3.4c-6-13.5 0-29.3 13.5-35.3s29.3 0 35.3 13.5l7.6-3.4z",children:(0,a.jsx)("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",dur:"2s",from:"0 50 50",to:"360 50 50",repeatCount:"indefinite"})})]}),n=l},88769:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});var a=s(37876),l=s(14232),n=s(99218),i=s(66637);let r=e=>{let{academy:t}=(0,l.useContext)(n.y2);return(0,a.jsx)("div",{style:(null==t?void 0:t.color)?(0,i.Bf)(null==t?void 0:t.color):{},className:`z-20 p-1.5 h-14 font-semibold rounded sm:rounded-none flex items-center overflow-x-auto overflow-y-visible shadow bg-primary text-on-primary ${e.styles}`,children:e.children})}}},e=>{e.O(0,[9897,713,1285,8230,636,6593,8792],()=>e(e.s=64406)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.