https://
The https:// in the address bar means your information is encrypted and can not be accessed by anyone else
.gov
Only government entities in the U.S. can end in .gov

Analytics

The City of Philadelphia has a unified web analytics strategy. Every web property should either use the following tracking code for webpages or the JavaScript implementation for applications.

This will allow the City to report on traffic, usage, clicks, and to collect other useful data about phila.gov websites and applications.

Analytics tracking for webpages

  1. Add the first snippet immediately after the opening <head> on your site, on every page.
    <!-- Google Tag Manager [phila.gov]  -->
    <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','GTM-MC6CR2');</script>
    <!-- End Google Tag Manager [phila.gov] -->
    <!-- Microsoft Clarity [phila.gov] -->
    <script type="text/javascript">
     (function(c,l,a,r,i,t,y){
         c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
         t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
         y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
     })(window, document, "clarity", "script", "4l8dhsl6kn");
    </script>
    <!-- End Microsoft Clarity [phila.gov] -->
  2. Add the second no-script snippet immediately after the opening <body> tag, on every page.
    <!-- Google Tag Manager no script [phila.gov] -->
    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MC6CR2"
    height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager no script [phila.gov] -->
  3. After you add these snippets to every page you want tracked, email websupport@phila.gov with the URL of the website for testing. You will receive confirmation that the site that should be tracked and the code is working.

Analytics for web applications

If you are using a JavaScript framework like Vue.js, the City recommends using vue-gtag. The City’s tag id is GTM-MC6CR2.

You should also add Microsoft Clarity tracking to the <head> of your application.

<!-- Microsoft Clarity [phila.gov] -->
<script type="text/javascript">
    (function(c,l,a,r,i,t,y){
        c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
        t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
        y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
    })(window, document, "clarity", "script", "4l8dhsl6kn");
</script>
<!-- End Microsoft Clarity [phila.gov] -->