How To Retrieve Your Web Channel ID

Troubleshooting implementation issues is much easier when we have the Device Identifier. This information is important (and usually required) when contacting Urban Airship Technical Support with setup, web push delivery, implementation, segmentation, or registration issues. The Device Identifier helps Urban Airship Technical Support find the device in the system and push logs; it is used to retrieve current device information in the system, as well as locate any previously sent web push notifications that were supposed to be delivered to the browser.

Ensure you are using a supported browser. See Supported Browsers for a complete list.

This article will walk you through the steps to reveal your web Channel ID as outlined in our Web Channel ID documentation. 

  1. Navigate to a page within your website that includes the Web Notify SDK.
    The page where you registered to receive web push notifications should meet this criterion.

  2. Open the Javascript Console.
    This step varies by browser. You can do this in Google Chrome by pressing Ctrl+Shift+J (Windows / Linux) or Cmd+Opt+J (Mac). See Web Channel ID for instructions for other browsers.

  3. Copy the following code:
    UA.then(sdk => {console.log(sdk.channel.id)})
    

     

  4. Paste the code into the prompt in the Javascript Console console_request.png

    Figure 1 - Google Chrome's Javascript Console

  5. Press enter/return to run the code. You will see one of the following responses:

     

    • If a browser has registered, the Channel ID will be returned. console_response.png

      Figure 2 - Channel ID is returned

    • The SDK will return null if the browser is unregistered. Only registered browsers will have a Channel ID. See our documentation on how to Register. console_null.png

      Figure 3 - Null response

    • A UA is not defined error can indicate that the SDK snippet is not present within the page. Navigate to a different page on your site and repeat the steps above.
      console_no_sdk.png

      Figure 4 - UA is not defined error

Related Content: