Skip to content

Latest commit

 

History

History
17 lines (9 loc) · 786 Bytes

File metadata and controls

17 lines (9 loc) · 786 Bytes

Adding Web Notifications Through GTM

This is a method to implement the Notifications API on any website through Google Tag Manager.

Setup

In order to limit notifications to one per session, you'll want to create a 1st Party Cookie Variable in GTM called "Session Alive" with Cookie Name set to "session":

Alt text

You can then simply copy and paste the code in GTM as a tag.

Credits

This is based on freeCodeCamp.org's Desktop Notifications - Beau teaches JavaScript and Simo Ahava's Send Weather Data To Google Analytics In GTM V2 .