HTTP Integration
This article is in continuation of Web Push integration series. The first article can be accessed here.
We enable you to subscribe your web users for HTTP domains as well.
For your HTTP domain, we will create an HTTPS subdomain (for ex. https://yourwebsite.moengage.com) because Web Push is only supported for HTTPS domains.

1. Select HTTP domain type
Select HTTP domain type in while setting up Web Push.
1.4. Customize your sub-domain
You can enter a sub-domain of your choice and click on Save.
2. Integrate the SDK
Initialize the SDK on your page with this App Id. Get your MoEngage App Id from the dashboard. Settings -> App Settings
<script type="text/javascript">
(function(i,s,o,g,r,a,m,n){i.moengage_object=r;t={};q=function(f){return function(){(i.moengage_q=i.moengage_q||[]).push({f:f,a:arguments})}};f=['track_event','add_user_attribute','add_first_name','add_last_name','add_email','add_mobile','add_user_name','add_gender','add_birthday','destroy_session','add_unique_user_id','moe_events','call_web_push','track','location_type_attribute'],h={onsite:["getData"]};for(k in f){t[f[k]]=q(f[k])}a=s.createElement(o);m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m);i.moe=i.moe||function(){n=arguments[0];return t};a.onload=function(){if(n){i[r]=moe(n)}}})(window,document,'script','https://cdn.moengage.com/webpush/moe_webSdk.min.latest.js','Moengage')
Moengage = moe({
app_id:"APP ID",
debug_logs: 0
});
</script>
Now, open your website to see the push permission opt-in and click on "Allow" button.
Updated almost 7 years ago
What’s Next