web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to install Google ...
Power Apps
Unanswered

How to install Google Tag Manager tracking code into either Power Apps or Visual Studio?

(1) ShareShare
ReportReport
Posted on by 2
Hi there 🤙

I'm wondering how you can install Google Tag Manager (GTM) tracking to an app built using Power Apps, Visual Studio, etc.

In Power Apps, can I go to every single page under Web Pages or Web Templates and add it in the Copy HTML section or CUstom Javascript section?

or

Do I need to go to the Visual Studio source code and paste it in there?

These are the GTM instructions:

Copy the code below and paste it onto every page of your website.
1. Paste this code as high in the <head> of the page as possible:

<!-- Google Tag Manager -->
<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','GTMID');</script>
<!-- End Google Tag Manager -->

2. Paste this code immediately after the opening <body> tag:

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-GTMID"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

Thnak you!

Categories:
I have the same question (0)
  • Forrest Zhang Profile Picture
    12 on at

    Hi Blair, you may refer to the following article.

    https://www.hellosmart.ca/2024/04/add-google-analytics-tag-to-your-power.html

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard