How to insert web push notification code to a website with the help of 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:

<script>
var head = document.getElementsByTagName ('head') [0];
var script = document.createElement ('script');
script.async = true;
script.src = 'CODE LINK';
head.appendChild (script);
</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 invoke 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 the help of Google Tag Manager"

User Rating: 5 / 5 (5)

    Other useful articles

    Popular in Our Blog

    Try SendPulse today for free