> ## Documentation Index
> Fetch the complete documentation index at: https://moengage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Web SDK Initialization

> Add the MoEngage Web SDK initialization script to your Flutter web application's index.html file.

Get the Workspace ID from the dashboard and replace "XXXXXXXXXXX" in the code below.

And get the Data Center according to your dashboard:

| Data Center | Dashboard host            |
| ----------- | ------------------------- |
| dc\_1       | dashboard-01.moengage.com |
| dc\_2       | dashboard-02.moengage.com |
| dc\_3       | dashboard-03.moengage.com |
| dc\_4       | dashboard-04.moengage.com |
| dc\_6       | dashboard-06.moengage.com |

1. Add this initialization script to your `web/index.html` file:

<CodeGroup>
  ```javascript JavaScript theme={null}
  <script type="text/javascript">
  var moeDataCenter = "{DC}"; // Replace "DC" with the actual Data center value from the above table
  var moeAppID = "{WorkspaceID}"; // Replace "WorkspaceID" available in the settings page of MoEngage Dashboard.
  var sdkVersion = "2"; // Replace this value with the version of Web SDK that you intend to use. It is recommended to use the format x (major)
  !function(e,n,i,t,a,r,o,d){if(!moeDataCenter||!moeDataCenter.match(/^dc_[0-9]+$/gm))return console.error("Data center has not been passed correctly. Please follow the SDK installation instruction carefully.");var s=e[a]=e[a]||[];if(s.initialized||s.initialised>0)return console.error("MoEngage Web SDK initialized multiple times. Please integrate the Web SDK only once!"),!1;s.invoked=0;e.moengage_object=a;var l={},g=function n(i){return function(){for(var n=arguments.length,t=Array(n),a=0;a<n;a++)t[a]=arguments[a];(e.moengage_q=e.moengage_q||[]).push({f:i,a:t})}},u=["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","update_unique_user_id","moe_events","call_web_push","track","location_type_attribute","setLogLevel","setDebugLevel","handle_page_change","identifyUser","getUserIdentities","trackEvent","trackPageView","track_page_view","setUserAttribute","setFirstName","setLastName","setEmailId","setMobileNumber","setUserName","setGender","setBirthDate","logoutUser","callWebPush","handlePageChange","enableSdk","disableSdk","enableDataTracking","disableDataTracking"],m={onsite:["getData","registerCallback","getSelfHandledOSM"]};for(var c in u)l[u[c]]=g(u[c]);for(var v in m)for(var f in m[v])null==l[v]&&(l[v]={}),l[v][m[v][f]]=g(v+"."+m[v][f]);r=n.createElement(i),o=n.getElementsByTagName("head")[0],r.async=1,r.src=t,o.appendChild(r),e.moe=e.moe||function(){return(s.invoked=s.invoked+1,s.invoked>1)?(console.error("MoEngage Web SDK initialized multiple times. Please integrate the Web SDK only once!"),!1):(d=arguments.length<=0?void 0:arguments[0],l)},r.addEventListener("load",function(){if(d)return e[a]=e.moe(d),(e[a]&&(e[a].initialised=e[a].initialised+1||1)),!0}),r.addEventListener("error",function(){return console.error("Moengage Web SDK loading failed."),!1})}(window,document,"script","https://cdn.moengage.com/release/"+moeDataCenter+"/versions/"+sdkVersion+"/moe_webSdk.min.latest.js","Moengage");

    Moengage = moe({
      appId: moeAppID,
      env: 'LIVE',
      logLevel: 0
      });
  </script>
  ```
</CodeGroup>

2. For web push integration refer this section of the Web Push guide.
