30% OFF web push notification service

Get an annual plan by September 30

How to Insert Web Push Notification Code to a Website with Google Tag Manager

If you don't have access to the source code of a site, you can add the code via Google Tag Manager.

In your SendPulse account, add a site where you want to send web push notifications.

To add the web push notification code to your site using Google Tag Manager, you will need a piece of the code that you will receive in your SendPulse account.

Website integration in the SendPulse account

Create a new tag in your Google Tag Manager account.

A new tag in GTM

Select the "Custom HTML" tag type.

Tag type selection

Add the following script into the "HTML" field in the "Tag Configuration" form:

var head = document.getElementsByTagName ('head') [0];
var script = document.createElement ('script');
script.async = true;
script.src = 'CODE LINK';
head.appendChild (script);

Where 'CODE LINK' is the site protocol, HTTP or HTTPS, and the code that you received in your SendPulse account.

Tag configuration

Configure the triggers which will activate the tag.

Tag triggers

Save the tag.

Submit the workspace changes in Google Tag Manager.

Submitting the workspace changes in GTM

Rate this article about "How to Insert Web Push Notification Code to a Website with Google Tag Manager"

User Rating: 5 / 5 (8)

    Other useful articles

    Popular in Our Blog

    Try SendPulse today for free