Skip to content

Commit

Permalink
Remove leftover partytown code [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
diegovalle committed Sep 19, 2024
1 parent 6e626af commit 4603083
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
19 changes: 19 additions & 0 deletions elcri.men/gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,22 @@
// </IntlProvider>
// )
// }

import React from 'react';


export const onRouteUpdate = ({ location }) => {
if (process.env.NODE_ENV !== 'production') {
return null;
}

const pagePath = location ? location.pathname + location.search + location.hash : undefined;

setTimeout(() => {
if (typeof window.gtag === 'function') {
window.gtag('event', 'page_view', { page_path: pagePath });
}
}, 100);

return true;
};
12 changes: 0 additions & 12 deletions elcri.men/src/components/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,6 @@ function Footer(props) {
{intl.formatMessage({ id: '© All rights reserved' })}
</p>
</div>
<Script
src={`https://www.googletagmanager.com/gtag/js?id=G-SMLSV8EVFV`}
strategy="off-main-thread"
/>
<Script id="gtag-config" strategy="off-main-thread" forward={[`gtag`]}>
{`window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-SMLSV8EVFV');
`}
</Script>
</footer>
</IconContext.Provider>
)
Expand Down
2 changes: 1 addition & 1 deletion elcri.men/src/components/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Layout = ({ locale, children, path, wide }) => {
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments)};
gtag('js', new Date());
gtag('config', 'G-SMLSV8EVFV', { page_path: location ? location.pathname + location.search + location.hash : undefined })
gtag('config', 'G-SMLSV8EVFV', { send_page_view: false })
`}
</Script>
<div
Expand Down

0 comments on commit 4603083

Please sign in to comment.