{"id":323,"date":"2016-11-15T15:11:45","date_gmt":"2016-11-15T09:41:45","guid":{"rendered":"https:\/\/pushalert.co\/blog\/?p=323"},"modified":"2017-02-24T14:51:10","modified_gmt":"2017-02-24T09:21:10","slug":"how-to-get-gcm-api-key-project-number","status":"publish","type":"post","link":"https:\/\/pushalert.co\/blog\/how-to-get-gcm-api-key-project-number\/","title":{"rendered":"How to get Project Number and API Key for GCM?"},"content":{"rendered":"<p style=\"background: #fcd04b; padding: 10px 15px; border-radius: 5px; font-size: 16px;\"><strong>Update:\u00a0<\/strong>Google has now started using Firebase Cloud Messaging for Web Push, this post is now outdated. You can see how to get the FCM ID and key from our <strong><a href=\"https:\/\/pushalert.co\/documentation\/firebase-config-web-push\">documentation here<\/a><\/strong>. However, if you had used your own GCM configuration with us, there is no need to change that, it is still applicable.<\/p>\n<p>Chrome currently uses Google Cloud Messaging (GCM) for web push notifications. By default\u00a0we use our own GCM account for notifications, it means your subscribers will be\u00a0associated with our account.\u00a0If you don&#8217;t have your own GCM account to work with, you won&#8217;t be able to export your subscriber list.<\/p>\n<p>To get a\u00a0GCM (Google Cloud Messaging) API key, you have to follow these steps:<\/p>\n<h2>Create a project<\/h2>\n<ol>\n<li>First go to the\u00a0<a href=\"https:\/\/console.developers.google.com\/\">Google Developer Console<\/a>. Then you have to accept the terms of service. Once done, in the top left you will see &#8220;Project&#8221; option. Click on it and select &#8220;Create project&#8221;.<picture><source srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/create-new-project-menu.png.webp 649w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/create-new-project-menu-300x120.png.webp 300w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/create-new-project-menu-549x220.png.webp 549w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" type=\"image\/webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-603 size-full webpexpress-processed\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/create-new-project-menu.png\" width=\"649\" height=\"260\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/create-new-project-menu.png 649w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/create-new-project-menu-300x120.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/create-new-project-menu-549x220.png 549w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\"><\/picture><\/li>\n<li>A dialog will appear, mention the Project name in the text box and click on &#8220;Create&#8221;. Be patient, this will take some time.<a href=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/07\/Project-Name.png\" target=\"_blank\"><br \/>\n<\/a><picture><source srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/project-name.png.webp 637w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/project-name-300x142.png.webp 300w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/project-name-464x220.png.webp 464w\" sizes=\"auto, (max-width: 637px) 100vw, 637px\" type=\"image\/webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-605 size-full webpexpress-processed\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/project-name.png\" width=\"637\" height=\"302\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/project-name.png 637w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/project-name-300x142.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/project-name-464x220.png 464w\" sizes=\"auto, (max-width: 637px) 100vw, 637px\"><\/picture><\/li>\n<li>Now, to get the Project Number, click on the &#8220;3-dots menu&#8221; at the top right and choose &#8220;Project settings&#8221;. A page will open up, just copy the Project Number and paste it into the PushAlert Dashboard.<a href=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/07\/gcm-project-id.png\" target=\"_blank\"><br \/>\n<\/a><picture><source srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/gcm-project-id.png.webp 549w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/gcm-project-id-300x186.png.webp 300w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/gcm-project-id-355x220.png.webp 355w\" sizes=\"auto, (max-width: 549px) 100vw, 549px\" type=\"image\/webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-606 size-full webpexpress-processed\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-project-id.png\" width=\"549\" height=\"340\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-project-id.png 549w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-project-id-300x186.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-project-id-355x220.png 355w\" sizes=\"auto, (max-width: 549px) 100vw, 549px\"><\/picture><picture><source srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/GCM-Project-ID-Info.png.webp 549w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/GCM-Project-ID-Info-300x146.png.webp 300w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/GCM-Project-ID-Info-451x220.png.webp 451w\" sizes=\"auto, (max-width: 549px) 100vw, 549px\" type=\"image\/webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-607 size-full webpexpress-processed\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/GCM-Project-ID-Info.png\" width=\"549\" height=\"268\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/GCM-Project-ID-Info.png 549w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/GCM-Project-ID-Info-300x146.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/GCM-Project-ID-Info-451x220.png 451w\" sizes=\"auto, (max-width: 549px) 100vw, 549px\"><\/picture><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2>GCM API Key<\/h2>\n<ol>\n<li>Now, head over to the sidebar, click on the overview menu and select &#8220;API Manager&#8221;. Then click on Dashboard, followed by &#8220;Enable API&#8221; on the right.<picture><source srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/gcm-enable-api.png.webp 639w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/gcm-enable-api-300x141.png.webp 300w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/gcm-enable-api-469x220.png.webp 469w\" sizes=\"auto, (max-width: 639px) 100vw, 639px\" type=\"image\/webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-608 webpexpress-processed\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-enable-api.png\" alt=\"gcm-enable-api\" width=\"639\" height=\"300\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-enable-api.png 639w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-enable-api-300x141.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-enable-api-469x220.png 469w\" sizes=\"auto, (max-width: 639px) 100vw, 639px\"><\/picture><\/li>\n<li>Once done, search for &#8220;google cloud messaging&#8221; in the text box and click on it. You will be redirected to Google Cloud Messaging\u00a0overview page, and then just click on\u00a0&#8220;Enable&#8221; at the top.<picture><source srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/Choose-Google-Cloud-Messaging.png.webp 782w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/Choose-Google-Cloud-Messaging-300x150.png.webp 300w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/Choose-Google-Cloud-Messaging-768x385.png.webp 768w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/Choose-Google-Cloud-Messaging-439x220.png.webp 439w\" sizes=\"auto, (max-width: 782px) 100vw, 782px\" type=\"image\/webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-609 size-full webpexpress-processed\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/Choose-Google-Cloud-Messaging.png\" width=\"782\" height=\"392\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/Choose-Google-Cloud-Messaging.png 782w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/Choose-Google-Cloud-Messaging-300x150.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/Choose-Google-Cloud-Messaging-768x385.png 768w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/Choose-Google-Cloud-Messaging-439x220.png 439w\" sizes=\"auto, (max-width: 782px) 100vw, 782px\"><\/picture><picture><source srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/enable-gcm.png.webp 469w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/enable-gcm-300x198.png.webp 300w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/enable-gcm-334x220.png.webp 334w\" sizes=\"auto, (max-width: 469px) 100vw, 469px\" type=\"image\/webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-611 size-full webpexpress-processed\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/enable-gcm.png\" width=\"469\" height=\"309\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/enable-gcm.png 469w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/enable-gcm-300x198.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/enable-gcm-334x220.png 334w\" sizes=\"auto, (max-width: 469px) 100vw, 469px\"><\/picture><\/li>\n<li>Go to &#8220;Credentials&#8221; tab available in\u00a0left sidebar. Now you will get one of the two options, either &#8220;Add credentials to your project&#8221; where you have to click on API key in the first step or &#8220;Create credentials&#8221;, where you have to select\u00a0API key option from a drop down menu.<picture><source srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/choose-credentials.png.webp 493w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/choose-credentials-300x156.png.webp 300w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/choose-credentials-424x220.png.webp 424w\" sizes=\"auto, (max-width: 493px) 100vw, 493px\" type=\"image\/webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-612 size-full webpexpress-processed\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/choose-credentials.png\" width=\"493\" height=\"256\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/choose-credentials.png 493w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/choose-credentials-300x156.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/choose-credentials-424x220.png 424w\" sizes=\"auto, (max-width: 493px) 100vw, 493px\"><\/picture><picture><source srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/create-credential-1.png.webp 538w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/create-credential-1-300x279.png.webp 300w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/create-credential-1-237x220.png.webp 237w\" sizes=\"auto, (max-width: 538px) 100vw, 538px\" type=\"image\/webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-613 size-full webpexpress-processed\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/create-credential-1.png\" width=\"538\" height=\"500\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/create-credential-1.png 538w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/create-credential-1-300x279.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/create-credential-1-237x220.png 237w\" sizes=\"auto, (max-width: 538px) 100vw, 538px\"><\/picture><\/li>\n<li>You will get the API Key directly with no restrictions applied, and if you are given the option to choose any restrictions just select &#8220;None&#8221;, type in a name and then press the &#8220;Create&#8221; button.<picture><source srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/api-key-name.png.webp 632w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/api-key-name-300x230.png.webp 300w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/api-key-name-287x220.png.webp 287w\" sizes=\"auto, (max-width: 632px) 100vw, 632px\" type=\"image\/webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-615 size-full webpexpress-processed\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/api-key-name.png\" width=\"632\" height=\"484\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/api-key-name.png 632w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/api-key-name-300x230.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/api-key-name-287x220.png 287w\" sizes=\"auto, (max-width: 632px) 100vw, 632px\"><\/picture><\/li>\n<li>Copy and paste the API key into PushAlert dashboard.<a href=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/07\/gcm-api-key-copy.jpg\" target=\"_blank\"><br \/>\n<\/a><picture><source srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/gcm-api-key.png.webp 590w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/gcm-api-key-300x157.png.webp 300w, https:\/\/pushalert.co\/blog\/wp-content\/webp-express\/webp-images\/uploads\/2016\/11\/gcm-api-key-420x220.png.webp 420w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" type=\"image\/webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-617 size-full webpexpress-processed\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-api-key.png\" width=\"590\" height=\"309\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-api-key.png 590w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-api-key-300x157.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-api-key-420x220.png 420w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\"><\/picture><\/li>\n<\/ol>\n<p>That&#8217;s it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update:\u00a0Google has now started using Firebase Cloud Messaging for Web Push, this post is now outdated. You can see how to get the FCM ID and key from our documentation here. However, if you had used your own GCM configuration with us, there is no need to change that, it is still applicable. Chrome currently [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":603,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[25,24,27,29,28],"class_list":["post-323","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial","tag-api-key","tag-gcm","tag-google-cloud-messaging","tag-project-number","tag-web-push-notifications"],"_links":{"self":[{"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/posts\/323","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/comments?post=323"}],"version-history":[{"count":34,"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/posts\/323\/revisions"}],"predecessor-version":[{"id":890,"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/posts\/323\/revisions\/890"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/media\/603"}],"wp:attachment":[{"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/media?parent=323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/categories?post=323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/tags?post=323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}