Adding OneSignal to your Website with Google Tag Manager
Copy the code provided in your OneSignal dashboard.
OneSignal.User.addTags
method.
Use the following code snippet to set tags. Replace "TAG_1"
and "VALUE_1"
with your desired tag key and value:
Create a trigger group for firing the tag
OneSignalInitialized
.Create the GTM tag for adding user profile tags
OneSignal.User.addTags
method.The added trigger group ensures that the tag fires only after OneSignal has initialized and when your chosen conditions are met.