Web Push via Google Tag Manager
How to implement push notifications on your website through Google Tag Manager
Last updated
How to implement push notifications on your website through Google Tag Manager
Last updated
Implement push notifications in four steps without any coding! Pushwoosh WebSDK Lite can be added to your website through Google Tag Manager, making the integration process as easy as possible.
Note that of all visitors of your website, only those using Chrome or Firefox would be able to subscribe for and receive push notifications. The WebSDK Lite also has limited access to Pushwoosh features, such as custom Tags, UserIDs, or event-triggered messaging. For details, please reach out to our Support Team!
In the Firebase Console, choose your project to obtain your Firebase Server Key and Sender ID. Please see the screenshot below for reference:
Go to Pushwoosh Control Panel and add a new app. On the opened page, configure Chrome or Firefox platform by clicking the Configure button in the respective row. Fill in the form:
The Server Key from Firebase Console into the API key field;
The Sender ID from Firebase Console into the FCM Sender ID field;
The exact address of your website into Website Name field.
Make sure to copy the Application Code of the newly created app, you'll need it later. The app code is highlighted below:
a. In Google Tag Manager, choose a container or create a new one.
b. Create a new Tag and choose Custom HTML in Tag Configuration.
c. Copy the script below and paste it into the HTML field;
d. Change number signs #####-#####
(highlighted on the picture below) in the script to your Pushwoosh Application Code, which you acquired in Step 2.
e. Scroll down to Triggering options and choose All Pages.
f. Click "Save". Your Tag is ready!
Let users subscribe for push notifications with a push subscription button. To set up the button, simply add the following script via Google Tag Manager.
All done! Your website's visitors can now subscribe for and receive push messages.