PxWeb 2022 and Google Analytics

28 views
Skip to first unread message

Oyvind Tomren

unread,
Sep 13, 2024, 9:43:52 AM9/13/24
to pcaxis

Hi everyone,

I’m currently setting up Google Tag Manager for our PxWeb statistics bank to collect data for Google Analytics. I already have the necessary GTM code, which is ready to be implemented. Since the City of Oslo has already been using this, the main task is adding the GTM code to the correct locations within PxWeb.

I’ve tried inserting the code into the pxweb.master file, but it didn’t work as expected. I was wondering if anyone here has experience with this and can advise on the proper way to implement Google Tag Manager in PX-Web? 

Best regards,
Øyvind Tomren

Petros Likidis

unread,
Sep 16, 2024, 1:57:16 AM9/16/24
to pca...@googlegroups.com
Hi,

We used to have Google Analytics. Now we use Matomo. But When we had GA we had added the following script in PxWeb.Master sight after the title element 

    <script>(function (w, d, s, l, i) {
            w[l] = w[l] || []; w[l].push({
                'gtm.start':

                    new Date().getTime(), event: 'gtm.js'
            }); var f = d.getElementsByTagName(s)[0],

                j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =

                    'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);

        })(window, document, 'script', 'dataLayer', 'YOUR_GTM_CODE');
    </script>

Kind regards
Petros


--
You received this message because you are subscribed to the Google Groups "pcaxis" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pcaxis+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pcaxis/f26f3238-69bb-4904-93a2-2bcaaeb08101n%40googlegroups.com.

Oyvind Tomren

unread,
Oct 11, 2024, 3:36:11 AM10/11/24
to pcaxis
Yes, got it working :) Thanks Petros!
Reply all
Reply to author
Forward
0 new messages