CINXE.COM
Add gtag.js to your site | Universal Analytics for Web (gtag.js) | Google Developers
<!doctype html> <html lang="en" dir="ltr"> <head><script type="text/javascript" src="/_static/js/bundle-playback.js?v=HxkREWBo" charset="utf-8"></script> <script type="text/javascript" src="/_static/js/wombat.js?v=txqj7nKC" charset="utf-8"></script> <script>window.RufflePlayer=window.RufflePlayer||{};window.RufflePlayer.config={"autoplay":"on","unmuteOverlay":"hidden"};</script> <script type="text/javascript" src="/_static/js/ruffle/ruffle.js"></script> <script type="text/javascript"> __wm.init("http://web.archive.org/web"); __wm.wombat("https://developers.google.com/analytics/devguides/collection/gtagjs","20221204152737","http://web.archive.org/","web","/_static/", "1670167657"); </script> <link rel="stylesheet" type="text/css" href="/_static/css/banner-styles.css?v=S1zqJCYt" /> <link rel="stylesheet" type="text/css" href="/_static/css/iconochive.css?v=3PDvdIFv" /> <!-- End Wayback Rewrite JS Include --> <meta name="google-signin-client-id" content="721724668570-nbkv1cfusk7kk4eni4pjvepaus73b13t.apps.googleusercontent.com"> <meta name="google-signin-scope" content="profile email https://www.googleapis.com/auth/developerprofiles https://www.googleapis.com/auth/developerprofiles.award"> <meta property="og:site_name" content="Google Developers"> <meta property="og:type" content="website"><meta name="robots" content="noindex"><meta name="theme-color" content="#e8710a"><meta charset="utf-8"> <meta content="IE=Edge" http-equiv="X-UA-Compatible"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="manifest" href="/web/20221204152737/https://developers.google.com/_pwa/developers/manifest.json" crossorigin="use-credentials"> <link rel="preconnect" href="//web.archive.org/web/20221204152737/https://www.gstatic.com/" crossorigin> <link rel="preconnect" href="//web.archive.org/web/20221204152737/https://fonts.gstatic.com/" crossorigin> <link rel="preconnect" href="//web.archive.org/web/20221204152737/https://fonts.googleapis.com/" crossorigin> <link rel="preconnect" href="//web.archive.org/web/20221204152737/https://apis.google.com/" crossorigin> <link rel="preconnect" href="//web.archive.org/web/20221204152737/https://www.google-analytics.com/" crossorigin><link rel="stylesheet" href="//web.archive.org/web/20221204152737cs_/https://fonts.googleapis.com/css?family=Google+Sans:400,500|Roboto:400,400italic,500,500italic,700,700italic|Roboto+Mono:400,500,700&display=swap"> <link rel="stylesheet" href="//web.archive.org/web/20221204152737cs_/https://fonts.googleapis.com/css2?family=Material+Icons&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block"><link rel="stylesheet" href="http://web.archive.org/web/20221204152737cs_/https://www.gstatic.com/devrel-devsite/prod/v04993a285e47ce7ae4bb513179c3071d4f2a8975b8f303b510c516323adf1b16/developers/css/app.css"> <link rel="shortcut icon" href="http://web.archive.org/web/20221204152737im_/https://www.gstatic.com/devrel-devsite/prod/v04993a285e47ce7ae4bb513179c3071d4f2a8975b8f303b510c516323adf1b16/developers/images/favicon.png"> <link rel="apple-touch-icon" href="http://web.archive.org/web/20221204152737im_/https://www.gstatic.com/devrel-devsite/prod/v04993a285e47ce7ae4bb513179c3071d4f2a8975b8f303b510c516323adf1b16/developers/images/touchicon-180.png"><link rel="canonical" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs"><link rel="search" type="application/opensearchdescription+xml" title="Google Developers" href="http://web.archive.org/web/20221204152737/https://developers.google.com/s/opensearch.xml"> <link rel="alternate" hreflang="en" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs"/><link rel="alternate" hreflang="x-default" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs"/><link rel="alternate" hreflang="ar" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=ar"/><link rel="alternate" hreflang="bn" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=bn"/><link rel="alternate" hreflang="zh-Hans" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=zh-cn"/><link rel="alternate" hreflang="zh-Hant" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=zh-tw"/><link rel="alternate" hreflang="fa" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=fa"/><link rel="alternate" hreflang="fr" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=fr"/><link rel="alternate" hreflang="de" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=de"/><link rel="alternate" hreflang="he" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=he"/><link rel="alternate" hreflang="hi" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=hi"/><link rel="alternate" hreflang="id" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=id"/><link rel="alternate" hreflang="it" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=it"/><link rel="alternate" hreflang="ja" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=ja"/><link rel="alternate" hreflang="ko" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=ko"/><link rel="alternate" hreflang="pl" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=pl"/><link rel="alternate" hreflang="pt-BR" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=pt-br"/><link rel="alternate" hreflang="ru" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=ru"/><link rel="alternate" hreflang="es" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=es"/><link rel="alternate" hreflang="es-419" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=es-419"/><link rel="alternate" hreflang="th" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=th"/><link rel="alternate" hreflang="tr" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=tr"/><link rel="alternate" hreflang="vi" href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs?hl=vi"/><title>Add gtag.js to your site | Universal Analytics for Web (gtag.js) | Google Developers</title> <meta property="og:title" content="Add gtag.js to your site | Universal Analytics for Web (gtag.js) | Google Developers"><meta name="description" content="A JavaScript tagging framework and API that lets you configure a site to send event data to Google Analytics, Google Ads, and Google Marketing Platform. "> <meta property="og:description" content="A JavaScript tagging framework and API that lets you configure a site to send event data to Google Analytics, Google Ads, and Google Marketing Platform. "><meta property="og:url" content="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs"><meta property="og:image" content="http://web.archive.org/web/20221204152737im_/https://www.gstatic.com/devrel-devsite/prod/v04993a285e47ce7ae4bb513179c3071d4f2a8975b8f303b510c516323adf1b16/developers/images/opengraph/orange.png"> <meta property="og:image:width" content="1200"> <meta property="og:image:height" content="675"><meta property="og:locale" content="en"><meta name="twitter:card" content="summary_large_image"><script type="application/ld+json"> { "@context": "http://web.archive.org/web/20221204152737/https://schema.org", "@type": "BreadcrumbList", "itemListElement": [{ "@type": "ListItem", "position": 1, "name": "Google Analytics", "item": "http://web.archive.org/web/20221204152737/https://developers.google.com/analytics" },{ "@type": "ListItem", "position": 2, "name": "Measurement", "item": "http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection" },{ "@type": "ListItem", "position": 3, "name": "Universal Analytics (gtag.js)", "item": "http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs" }] } </script> <link rel="stylesheet" href="/web/20221204152737cs_/https://developers.google.com/extras.css"></head> <body class="" template="page" theme="orange" type="product" layout="docs" pending> <devsite-progress type="indeterminate" id="app-progress"></devsite-progress> <section class="devsite-wrapper"><devsite-header> <div class="devsite-header--inner nocontent"> <div class="devsite-top-logo-row-wrapper-wrapper"> <div class="devsite-top-logo-row-wrapper"> <div class="devsite-top-logo-row"> <button type="button" id="devsite-hamburger-menu" class="devsite-header-icon-button button-flat material-icons gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Navigation menu button" visually-hidden aria-label="Open menu"> </button> <div class="devsite-product-name-wrapper"> <a href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics"> <div class="devsite-product-logo-container" size="medium"> <img class="devsite-product-logo" alt="Google Analytics" src="http://web.archive.org/web/20221204152737im_/https://www.gstatic.com/analytics-suite/header/suite/v2/ic_analytics.svg" srcset="" sizes="64px" loading="lazy"> </div> </a> <span class="devsite-product-name"> <ul class="devsite-breadcrumb-list" aria-label="Product breadcrumb"> <li class="devsite-breadcrumb-item devsite-has-google-wordmark"> <a href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics" class="devsite-breadcrumb-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Upper Header" data-value="1" track-type="globalNav" track-name="breadcrumb" track-metadata-position="1" track-metadata-eventdetail="Google Analytics"> <svg class="devsite-google-wordmark" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 148 48"> <title>Google</title> <path class="devsite-google-wordmark-svg-path" d="M19.58,37.65c-9.87,0-18.17-8.04-18.17-17.91c0-9.87,8.3-17.91,18.17-17.91c5.46,0,9.35,2.14,12.27,4.94l-3.45,3.45c-2.1-1.97-4.93-3.49-8.82-3.49c-7.21,0-12.84,5.81-12.84,13.02c0,7.21,5.64,13.02,12.84,13.02c4.67,0,7.34-1.88,9.04-3.58c1.4-1.4,2.32-3.41,2.66-6.16H19.58v-4.89h16.47c0.18,0.87,0.26,1.92,0.26,3.06c0,3.67-1.01,8.21-4.24,11.44C28.93,35.9,24.91,37.65,19.58,37.65z M61.78,26.12c0,6.64-5.1,11.53-11.36,11.53s-11.36-4.89-11.36-11.53c0-6.68,5.1-11.53,11.36-11.53S61.78,19.43,61.78,26.12z M56.8,26.12c0-4.15-2.96-6.99-6.39-6.99c-3.43,0-6.39,2.84-6.39,6.99c0,4.11,2.96,6.99,6.39,6.99C53.84,33.11,56.8,30.22,56.8,26.12z M87.25,26.12c0,6.64-5.1,11.53-11.36,11.53c-6.26,0-11.36-4.89-11.36-11.53c0-6.68,5.1-11.53,11.36-11.53C82.15,14.59,87.25,19.43,87.25,26.12zM82.28,26.12c0-4.15-2.96-6.99-6.39-6.99c-3.43,0-6.39,2.84-6.39,6.99c0,4.11,2.96,6.99,6.39,6.99C79.32,33.11,82.28,30.22,82.28,26.12z M112.09,15.29v20.7c0,8.52-5.02,12.01-10.96,12.01c-5.59,0-8.95-3.76-10.22-6.81l4.41-1.83c0.79,1.88,2.71,4.1,5.81,4.1c3.8,0,6.16-2.36,6.16-6.77v-1.66h-0.18c-1.14,1.4-3.32,2.62-6.07,2.62c-5.76,0-11.05-5.02-11.05-11.49c0-6.51,5.28-11.57,11.05-11.57c2.75,0,4.93,1.22,6.07,2.58h0.18v-1.88H112.09z M107.64,26.16c0-4.06-2.71-7.03-6.16-7.03c-3.49,0-6.42,2.97-6.42,7.03c0,4.02,2.93,6.94,6.42,6.94C104.93,33.11,107.64,30.18,107.64,26.16z M120.97,3.06v33.89h-5.07V3.06H120.97z M140.89,29.92l3.93,2.62c-1.27,1.88-4.32,5.11-9.61,5.11c-6.55,0-11.28-5.07-11.28-11.53c0-6.86,4.77-11.53,10.71-11.53c5.98,0,8.91,4.76,9.87,7.34l0.52,1.31l-15.42,6.38c1.18,2.31,3.01,3.49,5.59,3.49C137.79,33.11,139.58,31.84,140.89,29.92zM128.79,25.77l10.31-4.28c-0.57-1.44-2.27-2.45-4.28-2.45C132.24,19.04,128.66,21.31,128.79,25.77z"/> </svg>Analytics </a> </li> <li class="devsite-breadcrumb-item "> <div class="devsite-breadcrumb-guillemet material-icons" aria-hidden="true"></div> <a href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection" class="devsite-breadcrumb-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Upper Header" data-value="2" track-type="globalNav" track-name="breadcrumb" track-metadata-position="2" track-metadata-eventdetail="Google Analytics APIs"> Measurement </a> </li> <li class="devsite-breadcrumb-item "> <div class="devsite-breadcrumb-guillemet material-icons" aria-hidden="true"></div> <a href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs" class="devsite-breadcrumb-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Upper Header" data-value="3" track-type="globalNav" track-name="breadcrumb" track-metadata-position="3" track-metadata-eventdetail="Google Analytics - Universal Analytics for Web (gtag.js)"> Universal Analytics (gtag.js) </a> </li> </ul> </span> </div> <div class="devsite-top-logo-row-middle"> <div class="devsite-header-upper-tabs"> </div> <devsite-search aria-expanded="false" aria-haspopup="listbox" enable-signin enable-search enable-suggestions enable-query-completion project-name="Universal Analytics for Web (gtag.js)" tenant-name="Google Developers" project-scope="/analytics/devguides/collection/gtagjs" url-scoped="https://developers.google.com/s/results/analytics/devguides/collection/gtagjs" role="combobox"> <form class="devsite-search-form" action="http://web.archive.org/web/20221204152737/https://developers.google.com/s/results" method="GET"> <div class="devsite-search-container"> <div class="devsite-searchbox"> <input aria-activedescendant="" aria-autocomplete="list" aria-label="Search" aria-haspopup="false" aria-multiline="false" aria-label="Search box" autocomplete="off" class="devsite-search-field devsite-search-query" name="q" placeholder="Search" role="searchbox" type="text" value=""> <div class="devsite-search-image material-icons" aria-hidden="true"></div> </div> <button type="button" search-open class="devsite-search-button devsite-header-icon-button button-flat material-icons" aria-label="Open search"></button> </div> </form> <button type="button" search-close class="devsite-search-button devsite-header-icon-button button-flat material-icons" aria-label="Close search"></button> </devsite-search> </div> <devsite-language-selector> <ul role="presentation"> <li role="presentation"> <a role="menuitem" lang="en">English</a> </li> <li role="presentation"> <a role="menuitem" lang="id">Bahasa Indonesia</a> </li> <li role="presentation"> <a role="menuitem" lang="de">Deutsch</a> </li> <li role="presentation"> <a role="menuitem" lang="es">Español</a> </li> <li role="presentation"> <a role="menuitem" lang="es_419">Español – América Latina</a> </li> <li role="presentation"> <a role="menuitem" lang="fr">Français</a> </li> <li role="presentation"> <a role="menuitem" lang="it">Italiano</a> </li> <li role="presentation"> <a role="menuitem" lang="pl">Polski</a> </li> <li role="presentation"> <a role="menuitem" lang="pt_br">Português – Brasil</a> </li> <li role="presentation"> <a role="menuitem" lang="vi">Tiếng Việt</a> </li> <li role="presentation"> <a role="menuitem" lang="tr">Türkçe</a> </li> <li role="presentation"> <a role="menuitem" lang="ru">Русский</a> </li> <li role="presentation"> <a role="menuitem" lang="he">עברית</a> </li> <li role="presentation"> <a role="menuitem" lang="ar">العربيّة</a> </li> <li role="presentation"> <a role="menuitem" lang="fa">فارسی</a> </li> <li role="presentation"> <a role="menuitem" lang="hi">हिंदी</a> </li> <li role="presentation"> <a role="menuitem" lang="bn">বাংলা</a> </li> <li role="presentation"> <a role="menuitem" lang="th">ภาษาไทย</a> </li> <li role="presentation"> <a role="menuitem" lang="zh_cn">中文 – 简体</a> </li> <li role="presentation"> <a role="menuitem" lang="zh_tw">中文 – 繁體</a> </li> <li role="presentation"> <a role="menuitem" lang="ja">日本語</a> </li> <li role="presentation"> <a role="menuitem" lang="ko">한국어</a> </li> </ul> </devsite-language-selector> <devsite-user enable-profiles fp-auth id="devsite-user"> <span class="button devsite-top-button" aria-hidden="true" visually-hidden>Sign in</span> </devsite-user> </div> </div> </div> <div class="devsite-collapsible-section devsite-header-no-lower-tabs "> <div class="devsite-header-background"> </div> </div> </div> </devsite-header> <devsite-book-nav scrollbars> <div class="devsite-book-nav-filter "> <input type="text" placeholder="Filter" aria-label="Type to filter" role="searchbox"> <span class="filter-clear-button hidden" data-title="Clear filter" aria-label="Clear filter" role="button" tabindex="0"></span> </div> <nav class="devsite-book-nav devsite-nav nocontent" aria-label="Side menu"> <div class="devsite-mobile-header"> <button type="button" id="devsite-close-nav" class="devsite-header-icon-button button-flat material-icons gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Close navigation" aria-label="Close navigation"> </button> <div class="devsite-product-name-wrapper"> <a href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics"> <div class="devsite-product-logo-container" size="medium"> <img class="devsite-product-logo" alt="Google Analytics" src="http://web.archive.org/web/20221204152737im_/https://www.gstatic.com/analytics-suite/header/suite/v2/ic_analytics.svg" srcset="" sizes="64px" loading="lazy"> </div> </a> <span class="devsite-product-name"> <ul class="devsite-breadcrumb-list" aria-label="Upper header breadcrumb"> <li class="devsite-breadcrumb-item devsite-has-google-wordmark"> <a href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics" class="devsite-breadcrumb-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Upper Header" data-value="1" track-type="globalNav" track-name="breadcrumb" track-metadata-position="1" track-metadata-eventdetail="Google Analytics"> <svg class="devsite-google-wordmark" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 148 48"> <title>Google</title> <path class="devsite-google-wordmark-svg-path" d="M19.58,37.65c-9.87,0-18.17-8.04-18.17-17.91c0-9.87,8.3-17.91,18.17-17.91c5.46,0,9.35,2.14,12.27,4.94l-3.45,3.45c-2.1-1.97-4.93-3.49-8.82-3.49c-7.21,0-12.84,5.81-12.84,13.02c0,7.21,5.64,13.02,12.84,13.02c4.67,0,7.34-1.88,9.04-3.58c1.4-1.4,2.32-3.41,2.66-6.16H19.58v-4.89h16.47c0.18,0.87,0.26,1.92,0.26,3.06c0,3.67-1.01,8.21-4.24,11.44C28.93,35.9,24.91,37.65,19.58,37.65z M61.78,26.12c0,6.64-5.1,11.53-11.36,11.53s-11.36-4.89-11.36-11.53c0-6.68,5.1-11.53,11.36-11.53S61.78,19.43,61.78,26.12z M56.8,26.12c0-4.15-2.96-6.99-6.39-6.99c-3.43,0-6.39,2.84-6.39,6.99c0,4.11,2.96,6.99,6.39,6.99C53.84,33.11,56.8,30.22,56.8,26.12z M87.25,26.12c0,6.64-5.1,11.53-11.36,11.53c-6.26,0-11.36-4.89-11.36-11.53c0-6.68,5.1-11.53,11.36-11.53C82.15,14.59,87.25,19.43,87.25,26.12zM82.28,26.12c0-4.15-2.96-6.99-6.39-6.99c-3.43,0-6.39,2.84-6.39,6.99c0,4.11,2.96,6.99,6.39,6.99C79.32,33.11,82.28,30.22,82.28,26.12z M112.09,15.29v20.7c0,8.52-5.02,12.01-10.96,12.01c-5.59,0-8.95-3.76-10.22-6.81l4.41-1.83c0.79,1.88,2.71,4.1,5.81,4.1c3.8,0,6.16-2.36,6.16-6.77v-1.66h-0.18c-1.14,1.4-3.32,2.62-6.07,2.62c-5.76,0-11.05-5.02-11.05-11.49c0-6.51,5.28-11.57,11.05-11.57c2.75,0,4.93,1.22,6.07,2.58h0.18v-1.88H112.09z M107.64,26.16c0-4.06-2.71-7.03-6.16-7.03c-3.49,0-6.42,2.97-6.42,7.03c0,4.02,2.93,6.94,6.42,6.94C104.93,33.11,107.64,30.18,107.64,26.16z M120.97,3.06v33.89h-5.07V3.06H120.97z M140.89,29.92l3.93,2.62c-1.27,1.88-4.32,5.11-9.61,5.11c-6.55,0-11.28-5.07-11.28-11.53c0-6.86,4.77-11.53,10.71-11.53c5.98,0,8.91,4.76,9.87,7.34l0.52,1.31l-15.42,6.38c1.18,2.31,3.01,3.49,5.59,3.49C137.79,33.11,139.58,31.84,140.89,29.92zM128.79,25.77l10.31-4.28c-0.57-1.44-2.27-2.45-4.28-2.45C132.24,19.04,128.66,21.31,128.79,25.77z"/> </svg>Analytics </a> </li> <li class="devsite-breadcrumb-item "> <div class="devsite-breadcrumb-guillemet material-icons" aria-hidden="true"></div> <a href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection" class="devsite-breadcrumb-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Upper Header" data-value="2" track-type="globalNav" track-name="breadcrumb" track-metadata-position="2" track-metadata-eventdetail="Google Analytics APIs"> Measurement </a> </li> <li class="devsite-breadcrumb-item "> <div class="devsite-breadcrumb-guillemet material-icons" aria-hidden="true"></div> <a href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs" class="devsite-breadcrumb-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Upper Header" data-value="3" track-type="globalNav" track-name="breadcrumb" track-metadata-position="3" track-metadata-eventdetail="Google Analytics - Universal Analytics for Web (gtag.js)"> Universal Analytics (gtag.js) </a> </li> </ul> </span> </div> </div> <div class="devsite-book-nav-wrapper"> <div class="devsite-mobile-nav-top"> <ul class="devsite-nav-list"> <li class="devsite-nav-item"> <a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs" class="devsite-nav-title gc-analytics-event devsite-nav-has-children devsite-nav-active" data-category="Site-Wide Custom Events" data-label="Tab: Guides" track-name="guides" data-category="Site-Wide Custom Events" data-label="Responsive Tab: Guides" track-type="navMenu" track-metadata-eventdetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip> Guides </span> <span class="devsite-nav-icon material-icons" data-icon="forward"> </span> </a> </li> </ul> </div> <div class="devsite-mobile-nav-bottom" role="navigation"> <ul class="devsite-nav-list" menu="_book"> <li class="devsite-nav-item devsite-nav-heading"><div class="devsite-nav-title devsite-nav-title-no-path"> <span class="devsite-nav-text" tooltip>Get started</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs"><span class="devsite-nav-text" tooltip>Add gtag.js to your site</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/sending-data" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/sending-data"><span class="devsite-nav-text" tooltip>Send data to Google Analytics</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/setting-values" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/setting-values"><span class="devsite-nav-text" tooltip>Set persistent values</span></a></li></ul></li> <li class="devsite-nav-item devsite-nav-heading"><div class="devsite-nav-title devsite-nav-title-no-path"> <span class="devsite-nav-text" tooltip>Measure common user interactions</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/pages" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/pages"><span class="devsite-nav-text" tooltip>Pageviews</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/events" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/events"><span class="devsite-nav-text" tooltip>Events</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/phone-analytics" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/phone-analytics"><span class="devsite-nav-text" tooltip>Phone analytics</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/screens" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/screens"><span class="devsite-nav-text" tooltip>App / screen views</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/user-timings" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/user-timings"><span class="devsite-nav-text" tooltip>User timings</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/exceptions" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/exceptions"><span class="devsite-nav-text" tooltip>Exceptions</span></a></li></ul></li> <li class="devsite-nav-item devsite-nav-heading"><div class="devsite-nav-title devsite-nav-title-no-path"> <span class="devsite-nav-text" tooltip>Advanced</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/cookies-user-id"><span class="devsite-nav-text" tooltip>Cookies and user identification</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/cross-domain" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/cross-domain"><span class="devsite-nav-text" tooltip>Cross-domain measurement</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/custom-dims-mets" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/custom-dims-mets"><span class="devsite-nav-text" tooltip>Custom dimensions and metrics</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/display-features" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/display-features"><span class="devsite-nav-text" tooltip>Disable advertising features</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/enhanced-ecommerce" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/enhanced-ecommerce"><span class="devsite-nav-text" tooltip>Enhanced ecommerce</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/enhanced-link-attribution" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/enhanced-link-attribution"><span class="devsite-nav-text" tooltip>Enhanced link attribution</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/ip-anonymization" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/ip-anonymization"><span class="devsite-nav-text" tooltip>IP anonymization</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/renaming-the-gtag-object" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/renaming-the-gtag-object"><span class="devsite-nav-text" tooltip>Rename the global object</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/user-opt-out" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/user-opt-out"><span class="devsite-nav-text" tooltip>Disable Analytics for opted-out users</span></a></li></ul></li> <li class="devsite-nav-item devsite-nav-heading"><div class="devsite-nav-title devsite-nav-title-no-path"> <span class="devsite-nav-text" tooltip>Solutions</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/validate-with-tag-assistant" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/validate-with-tag-assistant"><span class="devsite-nav-text" tooltip>Check exceptions and custom dimensions and metrics</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/single-page-applications" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/single-page-applications"><span class="devsite-nav-text" tooltip>Single page applications</span></a></li></ul></li> <li class="devsite-nav-item devsite-nav-heading"><div class="devsite-nav-title devsite-nav-title-no-path"> <span class="devsite-nav-text" tooltip>Resources</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/cookie-usage" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/cookie-usage"><span class="devsite-nav-text" tooltip>Cookie usage</span></a></li><li class="devsite-nav-item"><a href="/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs/limits-quotas" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link" track-type="bookNav" track-name="click" track-metadata-eventdetail="/analytics/devguides/collection/gtagjs/limits-quotas"><span class="devsite-nav-text" tooltip>Limits and quotas</span></a></li></ul></li> </ul> </div> </div> </nav> </devsite-book-nav> <section id="gc-wrapper"> <main role="main" class="devsite-main-content" has-book-nav has-sidebar> <div class="devsite-sidebar"> <div class="devsite-sidebar-content"> <devsite-toc class="devsite-nav" role="navigation" aria-label="On this page" depth="2" scrollbars></devsite-toc> <devsite-recommendations-sidebar class="nocontent devsite-nav"> </devsite-recommendations-sidebar> </div> </div> <devsite-content> <article class="devsite-article"> <div class="devsite-banner devsite-banner-announcement" background="/web/20221204152737im_/https://developers.google.com/analytics/devguides/collection/google-yellow"> <div class="devsite-banner-message"> <div class="devsite-banner-message-text"> Universal Analytics (UA) will be deprecated on July 1, 2023, which means it will stop processing data. Analytics 360 properties will stop working on October 1, 2023. <a href="http://web.archive.org/web/20221204152737/https://support.google.com/analytics/answer/10759417">Migrate to Google Analytics 4</a>. </div> </div> </div> <div class="devsite-article-meta nocontent" role="navigation"> <ul class="devsite-breadcrumb-list" aria-label="Breadcrumb"> <li class="devsite-breadcrumb-item "> <a href="http://web.archive.org/web/20221204152737/https://developers.google.com/" class="devsite-breadcrumb-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Breadcrumbs" data-value="1" track-type="globalNav" track-name="breadcrumb" track-metadata-position="1" track-metadata-eventdetail=""> Home </a> </li> <li class="devsite-breadcrumb-item "> <div class="devsite-breadcrumb-guillemet material-icons" aria-hidden="true"></div> <a href="http://web.archive.org/web/20221204152737/https://developers.google.com/products" class="devsite-breadcrumb-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Breadcrumbs" data-value="2" track-type="globalNav" track-name="breadcrumb" track-metadata-position="2" track-metadata-eventdetail=""> Products </a> </li> <li class="devsite-breadcrumb-item "> <div class="devsite-breadcrumb-guillemet material-icons" aria-hidden="true"></div> <a href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics" class="devsite-breadcrumb-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Breadcrumbs" data-value="3" track-type="globalNav" track-name="breadcrumb" track-metadata-position="3" track-metadata-eventdetail="Google Analytics"> Google Analytics </a> </li> <li class="devsite-breadcrumb-item "> <div class="devsite-breadcrumb-guillemet material-icons" aria-hidden="true"></div> <a href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection" class="devsite-breadcrumb-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Breadcrumbs" data-value="4" track-type="globalNav" track-name="breadcrumb" track-metadata-position="4" track-metadata-eventdetail="Google Analytics APIs"> Measurement </a> </li> <li class="devsite-breadcrumb-item "> <div class="devsite-breadcrumb-guillemet material-icons" aria-hidden="true"></div> <a href="http://web.archive.org/web/20221204152737/https://developers.google.com/analytics/devguides/collection/gtagjs" class="devsite-breadcrumb-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Breadcrumbs" data-value="5" track-type="globalNav" track-name="breadcrumb" track-metadata-position="5" track-metadata-eventdetail="Google Analytics - Universal Analytics for Web (gtag.js)"> Universal Analytics (gtag.js) </a> </li> </ul> <devsite-thumb-rating position="header"> </devsite-thumb-rating> </div> <h1 class="devsite-page-title">Add gtag.js to your site</h1><devsite-feature-tooltip ack-key="AckCollectionsBookmarkTooltipDismiss" analytics-category="Site-Wide Custom Events" analytics-action-show="Callout Profile displayed" analytics-action-close="Callout Profile dismissed" analytics-label="Create Collection Callout" class="devsite-page-bookmark-tooltip" dismiss-button="true" id="devsite-collections-dropdown" dismiss-button-text="Dismiss" close-button-text="Got it"> <devsite-bookmark></devsite-bookmark> <span slot="popout-heading"> Stay organized with collections </span> <span slot="popout-contents"> Save and categorize content based on your preferences. </span> </devsite-feature-tooltip> <devsite-toc class="devsite-nav" depth="2" devsite-toc-embedded> </devsite-toc> <div class="devsite-article-body clearfix "> <p>The Google tag (gtag.js) is a JavaScript tagging framework and API that allows you to send event data to Google Analytics, Google Ads, and Google Marketing Platform. This page describes how to use gtag.js to configure a site for Google Analytics. For general (i.e. non-product specific) gtag.js documentation, read the <a href="/web/20221204152737/https://developers.google.com/gtagjs">gtag.js developer guide</a>.</p> <h2 id="install_the_google_tag" data-text="Install the Google tag">Install the Google tag</h2> <p>To install the Google tag, copy the following code and paste it immediately after the <code translate="no" dir="ltr"><head></code> tag on every page of your site. Replace <strong><code translate="no" dir="ltr">GA_TRACKING_ID</code></strong> with the ID of the Google Analytics property to which you want to send data. You need only one snippet per page.</p> <pre id="snippet" class="prettyprint" translate="no" dir="ltr"> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){window.dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'GA_TRACKING_ID'); </script> </pre> <p>This snippet loads the gtag.js library, establishes <code translate="no" dir="ltr">GA_TRACKING_ID</code> as the default Google Analytics property ID, and sends a <a href="http://web.archive.org/web/20221204152737/https://support.google.com/analytics/answer/6086080">pageview hit</a> to Google Analytics.</p> <h2 id="disable_pageview_measurement" data-text="Disable pageview measurement">Disable pageview measurement</h2> <p>The default behavior of this snippet is to send a pageview hit to Google Analytics. This is the desired behavior in most cases; pageviews are automatically recorded once you add the snippet to each page on your site. However, if you don’t want the snippet to send a pageview hit to Google Analytics, set the <code translate="no" dir="ltr">send_page_view</code> parameter to <code translate="no" dir="ltr">false</code>:</p> <pre class="prettyprint" translate="no" dir="ltr"><code translate="no" dir="ltr">gtag('config', 'GA_TRACKING_ID', { 'send_page_view': false }); </code></pre> <h2 id="configure_additional_google_analytics_properties" data-text="Configure additional Google Analytics properties">Configure additional Google Analytics properties</h2> <p>By default, the snippet configures a single Google Analytics property. To configure a second Google Analytics property with the Tracking ID <code translate="no" dir="ltr">GA_TRACKING_ID_2</code>, add an additional <code translate="no" dir="ltr">config</code> command:</p> <pre class="prettyprint" translate="no" dir="ltr"><code translate="no" dir="ltr">gtag('config', 'GA_TRACKING_ID_2'); </code></pre> </div> <devsite-thumb-rating position="footer"> </devsite-thumb-rating> </article> <devsite-content-footer class="nocontent"> <p>Except as otherwise noted, the content of this page is licensed under the <a href="http://web.archive.org/web/20221204152737/https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 License</a>, and code samples are licensed under the <a href="http://web.archive.org/web/20221204152737/https://www.apache.org/licenses/LICENSE-2.0">Apache 2.0 License</a>. For details, see the <a href="http://web.archive.org/web/20221204152737/https://developers.google.com/site-policies">Google Developers Site Policies</a>. Java is a registered trademark of Oracle and/or its affiliates.</p> <p>Last updated 2022-10-27 UTC.</p> </devsite-content-footer> <devsite-notification> </devsite-notification> <div class="devsite-content-data"> <template class="devsite-thumb-rating-down-categories"> [{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }] </template> <template class="devsite-thumb-rating-up-categories"> [{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }] </template> </div> </devsite-content> </main> <devsite-footer-promos class="devsite-footer"> <nav class="devsite-footer-promos nocontent" aria-label="Promotions"> <ul class="devsite-footer-promos-list"> <li class="devsite-footer-promo"> <a href="http://web.archive.org/web/20221204152737/https://goo.gle/ga-newsletter" class="devsite-footer-promo-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Promo Link (index 1)"> <img class="devsite-footer-promo-icon" src="http://web.archive.org/web/20221204152737im_/https://www.gstatic.com/images/branding/product/1x/email_64dp.png" loading="lazy" alt="Newsletter"> Newsletter </a> <div class="devsite-footer-promo-description">Sign up for Google Analytics developer newsletter</div> </li> <li class="devsite-footer-promo"> <a href="http://web.archive.org/web/20221204152737/https://goo.gle/ga-discord" class="devsite-footer-promo-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Promo Link (index 2)"> <img class="devsite-footer-promo-icon" src="/web/20221204152737im_/https://developers.google.com/static/analytics/images/logo-discord.svg" loading="lazy" alt="Discord"> Discord </a> <div class="devsite-footer-promo-description">Join Google Analytics Discord server</div> </li> <li class="devsite-footer-promo"> <a href="http://web.archive.org/web/20221204152737/https://github.com/googleanalytics/" class="devsite-footer-promo-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Promo Link (index 3)"> <img class="devsite-footer-promo-icon" src="/web/20221204152737im_/https://developers.google.com/static/site-assets/logo-github.svg" loading="lazy" alt="GitHub"> GitHub </a> <div class="devsite-footer-promo-description">Try Google Analytics samples</div> </li> <li class="devsite-footer-promo"> <a href="http://web.archive.org/web/20221204152737/http://stackoverflow.com/questions/tagged/google-analytics" class="devsite-footer-promo-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Promo Link (index 4)"> <img class="devsite-footer-promo-icon" src="/web/20221204152737im_/https://developers.google.com/static/site-assets/logo-stack-overflow.svg" loading="lazy" alt="Stack Overflow"> Stack Overflow </a> <div class="devsite-footer-promo-description">Ask questions using the google-analytics tag</div> </li> <li class="devsite-footer-promo"> <a href="http://web.archive.org/web/20221204152737/https://www.youtube.com/user/googleanalytics" class="devsite-footer-promo-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Promo Link (index 5)"> <img class="devsite-footer-promo-icon" src="http://web.archive.org/web/20221204152737im_/https://www.gstatic.com/images/icons/material/product/2x/youtube_64dp.png" loading="lazy" alt="Videos"> Videos </a> <div class="devsite-footer-promo-description">View Google Analytics videos on YouTube</div> </li> </ul> </nav> </devsite-footer-promos> <devsite-footer-linkboxes class="devsite-footer"> <nav class="devsite-footer-linkboxes nocontent" aria-label="Footer links"> <ul class="devsite-footer-linkboxes-list"> <li class="devsite-footer-linkbox "> <h3 class="devsite-footer-linkbox-heading no-link">Connect</h3> <ul class="devsite-footer-linkbox-list"> <li class="devsite-footer-linkbox-item"> <a href="/web/20221204152737/https://developers.google.com/analytics/community" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 1)"> Community & Updates </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/web/20221204152737/https://developers.google.com/analytics/help" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 2)"> Getting Help </a> </li> <li class="devsite-footer-linkbox-item"> <a href="http://web.archive.org/web/20221204152737/https://issuetracker.google.com/issues?q=componentid:187400" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 3)"> Reporting an Issue </a> </li> </ul> </li> <li class="devsite-footer-linkbox "> <h3 class="devsite-footer-linkbox-heading no-link">Product Info</h3> <ul class="devsite-footer-linkbox-list"> <li class="devsite-footer-linkbox-item"> <a href="/web/20221204152737/https://developers.google.com/analytics/policy" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 1)"> Protocol / SDK Policy </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/web/20221204152737/https://developers.google.com/analytics/terms/branding-policy" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 2)"> Branding Policy </a> </li> </ul> </li> <li class="devsite-footer-linkbox "> <h3 class="devsite-footer-linkbox-heading no-link">Developer consoles</h3> <ul class="devsite-footer-linkbox-list"> <li class="devsite-footer-linkbox-item"> <a href="//web.archive.org/web/20221204152737/https://console.developers.google.com/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 1)"> Google API Console </a> </li> <li class="devsite-footer-linkbox-item"> <a href="//web.archive.org/web/20221204152737/https://console.cloud.google.com/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 2)"> Google Cloud Platform Console </a> </li> <li class="devsite-footer-linkbox-item"> <a href="//web.archive.org/web/20221204152737/https://play.google.com/apps/publish" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 3)"> Google Play Console </a> </li> <li class="devsite-footer-linkbox-item"> <a href="//web.archive.org/web/20221204152737/https://console.firebase.google.com/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 4)"> Firebase Console </a> </li> <li class="devsite-footer-linkbox-item"> <a href="//web.archive.org/web/20221204152737/https://console.actions.google.com/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 5)"> Actions on Google Console </a> </li> <li class="devsite-footer-linkbox-item"> <a href="//web.archive.org/web/20221204152737/https://cast.google.com/publish" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 6)"> Cast SDK Developer Console </a> </li> <li class="devsite-footer-linkbox-item"> <a href="//web.archive.org/web/20221204152737/https://chrome.google.com/webstore/developer/dashboard" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 7)"> Chrome Web Store Dashboard </a> </li> </ul> </li> </ul> </nav> </devsite-footer-linkboxes> <devsite-footer-utility class="devsite-footer"> <div class="devsite-footer-utility nocontent"> <nav class="devsite-footer-sites" aria-label="Other Google Developers websites"> <a href="http://web.archive.org/web/20221204152737/https://developers.google.com/" class="devsite-footer-sites-logo-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Google Developers Link"> <picture> <source srcset="http://web.archive.org/web/20221204152737im_/https://www.gstatic.com/devrel-devsite/prod/v04993a285e47ce7ae4bb513179c3071d4f2a8975b8f303b510c516323adf1b16/developers/images/lockup-developers-dark-theme.svg" media="(prefers-color-scheme: none)" class="devsite-dark-theme" loading="lazy" alt="Google Developers"> <img class="devsite-footer-sites-logo" src="http://web.archive.org/web/20221204152737im_/https://www.gstatic.com/devrel-devsite/prod/v04993a285e47ce7ae4bb513179c3071d4f2a8975b8f303b510c516323adf1b16/developers/images/lockup-developers.svg" loading="lazy" alt="Google Developers"> </picture> </a> <ul class="devsite-footer-sites-list"> <li class="devsite-footer-sites-item"> <a href="//web.archive.org/web/20221204152737/https://developer.android.com/" class="devsite-footer-sites-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Android Link"> Android </a> </li> <li class="devsite-footer-sites-item"> <a href="//web.archive.org/web/20221204152737/https://developer.chrome.com/home" class="devsite-footer-sites-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Chrome Link"> Chrome </a> </li> <li class="devsite-footer-sites-item"> <a href="//web.archive.org/web/20221204152737/https://firebase.google.com/" class="devsite-footer-sites-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Firebase Link"> Firebase </a> </li> <li class="devsite-footer-sites-item"> <a href="//web.archive.org/web/20221204152737/https://cloud.google.com/" class="devsite-footer-sites-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Google Cloud Platform Link"> Google Cloud Platform </a> </li> <li class="devsite-footer-sites-item"> <a href="/web/20221204152737/https://developers.google.com/products" class="devsite-footer-sites-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer All products Link"> All products </a> </li> </ul> </nav> <nav class="devsite-footer-utility-links" aria-label="Utility links"> <ul class="devsite-footer-utility-list"> <li class="devsite-footer-utility-item "> <a class="devsite-footer-utility-link gc-analytics-event" href="/web/20221204152737/https://developers.google.com/terms/site-terms" data-category="Site-Wide Custom Events" data-label="Footer Terms link"> Terms </a> </li> <li class="devsite-footer-utility-item "> <a class="devsite-footer-utility-link gc-analytics-event" href="//web.archive.org/web/20221204152737/https://policies.google.com/privacy" data-category="Site-Wide Custom Events" data-label="Footer Privacy link"> Privacy </a> </li> <li class="devsite-footer-utility-item devsite-footer-utility-button"> <span class="devsite-footer-utility-description">Sign up for the Google Developers newsletter</span> <a class="devsite-footer-utility-link gc-analytics-event" href="//web.archive.org/web/20221204152737/https://services.google.com/fb/forms/googledevelopersnewsletter/?utm_medium=referral&utm_source=google-products&utm_team=googledevs&utm_campaign=201611-newsletter-launch" data-category="Site-Wide Custom Events" data-label="Footer Subscribe link"> Subscribe </a> </li> </ul> <devsite-language-selector> <ul role="presentation"> <li role="presentation"> <a role="menuitem" lang="en">English</a> </li> <li role="presentation"> <a role="menuitem" lang="id">Bahasa Indonesia</a> </li> <li role="presentation"> <a role="menuitem" lang="de">Deutsch</a> </li> <li role="presentation"> <a role="menuitem" lang="es">Español</a> </li> <li role="presentation"> <a role="menuitem" lang="es_419">Español – América Latina</a> </li> <li role="presentation"> <a role="menuitem" lang="fr">Français</a> </li> <li role="presentation"> <a role="menuitem" lang="it">Italiano</a> </li> <li role="presentation"> <a role="menuitem" lang="pl">Polski</a> </li> <li role="presentation"> <a role="menuitem" lang="pt_br">Português – Brasil</a> </li> <li role="presentation"> <a role="menuitem" lang="vi">Tiếng Việt</a> </li> <li role="presentation"> <a role="menuitem" lang="tr">Türkçe</a> </li> <li role="presentation"> <a role="menuitem" lang="ru">Русский</a> </li> <li role="presentation"> <a role="menuitem" lang="he">עברית</a> </li> <li role="presentation"> <a role="menuitem" lang="ar">العربيّة</a> </li> <li role="presentation"> <a role="menuitem" lang="fa">فارسی</a> </li> <li role="presentation"> <a role="menuitem" lang="hi">हिंदी</a> </li> <li role="presentation"> <a role="menuitem" lang="bn">বাংলা</a> </li> <li role="presentation"> <a role="menuitem" lang="th">ภาษาไทย</a> </li> <li role="presentation"> <a role="menuitem" lang="zh_cn">中文 – 简体</a> </li> <li role="presentation"> <a role="menuitem" lang="zh_tw">中文 – 繁體</a> </li> <li role="presentation"> <a role="menuitem" lang="ja">日本語</a> </li> <li role="presentation"> <a role="menuitem" lang="ko">한국어</a> </li> </ul> </devsite-language-selector> </nav> </div> </devsite-footer-utility> <devsite-panel></devsite-panel> </section></section> <devsite-sitemask></devsite-sitemask> <devsite-snackbar> </devsite-snackbar> <devsite-tooltip></devsite-tooltip> <devsite-heading-link></devsite-heading-link> <devsite-analytics analytics-iframe> <script type="application/json" analytics>[{"dimensions": {"dimension1": "Signed out", "dimension6": "en", "dimension3": false, "dimension5": "en", "dimension4": "Universal Analytics for Web (gtag.js)", "dimension11": false}, "gaid": "UA-24532603-1", "metrics": {"ratings_count": "metric2", "ratings_value": "metric1"}}, {"dimensions": {"dimension1": "Signed out", "dimension6": "en", "dimension3": false, "dimension5": "en", "dimension4": "Universal Analytics for Web (gtag.js)", "dimension11": false}, "gaid": "UA-41425441-2", "metrics": {"ratings_count": "metric2", "ratings_value": "metric1"}}]</script> <script type="application/json" gtm>{"parameters": {"internalUser": "False", "language": {"machineTranslated": "False", "requested": "en", "served": "en"}, "pageType": "product", "projectName": "Universal Analytics for Web (gtag.js)", "signedIn": "False", "tenant": "developers", "recommendations": {"sourcePage": "", "sourceType": 0, "sourceRank": 0, "sourceIdenticalDescriptions": 0, "sourceTitleWords": 0, "sourceDescriptionWords": 0, "experiment": ""}, "experiment": {"ids": ""}}, "tags": []}</script> </devsite-analytics> <devsite-badger></devsite-badger> <script nonce="7JwaUwPhAfA08VlpgNEUYhGY0s3yCf"> (function(d,e,v,s,i,t,E){d['GoogleDevelopersObject']=i; t=e.createElement(v);t.async=1;t.src=s;E=e.getElementsByTagName(v)[0]; E.parentNode.insertBefore(t,E);})(window, document, 'script', 'http://web.archive.org/web/20221204152737/https://www.gstatic.com/devrel-devsite/prod/v04993a285e47ce7ae4bb513179c3071d4f2a8975b8f303b510c516323adf1b16/developers/js/app_loader.js', '[1,"en",null,"/js/devsite_app_module.js","http://web.archive.org/web/20221204152737/https://www.gstatic.com/devrel-devsite/prod/v04993a285e47ce7ae4bb513179c3071d4f2a8975b8f303b510c516323adf1b16","http://web.archive.org/web/20221204152737/https://www.gstatic.com/devrel-devsite/prod/v04993a285e47ce7ae4bb513179c3071d4f2a8975b8f303b510c516323adf1b16/developers","http://web.archive.org/web/20221204152737/https://developers-dot-devsite-v2-prod.appspot.com",1,null,["/_pwa/developers/manifest.json","http://web.archive.org/web/20221204152737/https://www.gstatic.com/devrel-devsite/prod/v04993a285e47ce7ae4bb513179c3071d4f2a8975b8f303b510c516323adf1b16/images/video-placeholder.svg","http://web.archive.org/web/20221204152737/https://www.gstatic.com/devrel-devsite/prod/v04993a285e47ce7ae4bb513179c3071d4f2a8975b8f303b510c516323adf1b16/developers/images/favicon.png","http://web.archive.org/web/20221204152737/https://fonts.googleapis.com/css?family=Google+Sans:400,500|Roboto:400,400italic,500,500italic,700,700italic|Roboto+Mono:400,500,700&display=swap"],1,null,[1,6,8,12,14,17,21,25,40,50,52,63,70,75,76,80,87,91,92,93,97,98,100,101,102,103,104,105,107,108,109,110,111,112,113,115,116,117,118,120,122,124,125,126,127,129,130,131,132,133,134,135,136,138,140,141,144,147,148,149,150,151,152,154,155,156,157,158,159,161,163,164,165,168,169,170,172,173,179,180,182,183,186,190,191,193,196],"AIzaSyAP-jjEJBzmIyKR4F-3XITp8yM9T1gEEI8","AIzaSyB6xiKGDR5O3Ak2okS4rLkauxGUG7XP0hg","developers.google.com","AIzaSyAQk0fBONSGUqCNznf6Krs82Ap1-NV6J4o","AIzaSyCCxcqdrZ_7QMeLCRY20bh_SXdAYqy70KY",null,null,null,["BookNav__enable_collapsible_book_nav","Profiles__enable_developer_profiles_callout","MiscFeatureFlags__emergency_css","Profiles__enable_page_saving","MiscFeatureFlags__enable_tls_version_for_gaia_calls","Search__enable_devsite_serp","Cloud__enable_cloud_facet_chat","Search__enable_page_map","Cloud__enable_cloud_shell","Search__enable_acl_suggestions","Profiles__enable_developer_profiles_dashboard_recommendations","Search__enable_suggestions_from_borg","BookNav__enable_book_nav_filtering","Badges__enable_delete_badges","Profiles__enable_public_developer_profiles","Cloud__enable_cloud_dlp_service","Experiments__enable_experiments","Profiles__require_profile_eligibility_for_signin","MiscFeatureFlags__enable_footprints_record_views","Cloud__enable_cloud_shell_fte_user_flow","Cloud__enable_cloudx_experiment_ids","SignIn__enable_auto_signin_oauth","Profiles__enable_developer_profiles_interests","Profiles__enable_profile_notifications_ui","Significatio__enable_experiment_id_caching","Significatio__enable_by_tenant","Badges__enable_drag_and_drop_badges","Profiles__enable_profile_collections","Experiments__reqs_query_experiments"]]') </script> <devsite-a11y-announce></devsite-a11y-announce> </body> </html><!-- FILE ARCHIVED ON 15:27:37 Dec 04, 2022 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 14:40:26 Dec 11, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). --> <!-- playback timings (ms): captures_list: 0.89 exclusion.robots: 0.065 exclusion.robots.policy: 0.047 esindex: 0.023 cdx.remote: 14.418 LoadShardBlock: 159.974 (3) PetaboxLoader3.datanode: 110.873 (4) load_resource: 169.797 PetaboxLoader3.resolve: 110.34 -->