Must-Do Items Before Launch Our Website
Tags: seo, ga, gtm
Published: 2020-01-19 13:36:17

<blockquote>
Before we launch our MVP (minimum viable product). There still some important things we need to do except finish all the high priority features and fix most of the bugs. In this article, I will like to show you what I usually do before I launch a new website.
</blockquote>

### 1. sitemap.xml & robots.txt
To make sure Google and other search engines can find our website, provide the sitemap and robots.txt is something we must do. You can check the links below to know how to format the sitemap and robots.txt properly.
- [sitemap.xml](https://www.sitemaps.org/protocol.html)
- [robots.txt](https://support.google.com/webmasters/answer/6062596?hl=en)

Then we host those files on our website's root folder.
- https://{website-url}/sitemap.xml
- https://{website-url}/robots.txt


### 2. Google Search Console
[Google Search Console](https://search.google.com/search-console/welcome) can help us trace our website, provide tons of useful information. Moreover, it will verify lots of mistakes we might make, to make sure the search engine can identify our website properly.
After we create our sitemap, don't just wait for google to find it. We can submit the sitemap on google search console.
![submit sitemap](https://i.imgur.com/rifqMxw.png)
Google search console can also help us verify robots.txt, so we can find all the errors immediately.
![robots.txt](https://i.imgur.com/JF5OtZ1.png)

It's very easy to add our website to google search console, just input the domain or URL then it will generate a file. Put the file under the website's root folder then we can start us it.
![google search console](https://i.imgur.com/5exhnNJ.png)

Bing also provides a similar tool for us. So you can use [Bing webmaster](https://www.bing.com/toolbox/webmaster) if Bing has high market share within your users.


### 3. Meta Data
Except for the search engine, social media is also something we need to take care of. So we need to provide proper meta for them.
[Meta Tags](https://metatags.io/) is a great tool can help us figure out all the meta tag we need. We just have to select the platform we need to support, then click the generate button, it will tell us all the meta tags we should add to our website.
![meta-tags](https://i.imgur.com/r7wTUNP.png)

After we finish the meta tags, we can use the tool provided by Facebook and Twitter, to preview the result.
- [Facebook debug tools](https://developers.facebook.com/tools/debug/)
  ![fb debugger](https://i.imgur.com/g0Eqp5R.png)
- [Twitter validator](https://cards-dev.twitter.com/validator)
  ![twitter validator](https://i.imgur.com/swws6kl.png)


### 4. Google Analytics & GTM
To have a better understanding of our users, we need to apply some services like [Google Analytics](https://analytics.google.com/) to analyze their browsing behavior.
If we want to integrate more third-party services into our website. Using [GTM](https://tagmanager.google.com/) might be a good choice. We only need to add the GTM script into our codebase. Then we can integrate third-party services through GTM console. And GTM provides version control so we can manage those services properly without mess up our code.
[Here](https://support.google.com/tagmanager/answer/6106924?hl=en) are the services supported by GTM. We can even add a custom
script tag through GTM. (convenient but also danger, so make sure to control the GTM permission properly)

Another service can help us uncover the insight of our users is [Hotjar](https://www.hotjar.com/). It provides the heatmaps and recordings of our users' behavior. We can use it to figure out why users like or dislike our website.


### 5. Structured Data (JSON-LD Schema)
Have you ever wondered why some website has a more fancy search result in google search page? 
We can add the Structured Data for our website. This will allow the search engine to have a better understanding of our website. Therefore, it will be able to provide more information on the search result.
There are two ways to provide structured data for our website.
First is through [JSON-LD](https://json-ld.org/)
```html
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "url": "http://www.example.com",
  "name": "Unlimited Ball Bearings Corp.",
  "contactPoint": {
    "@type": "ContactPoint",
    "telephone": "+1-401-555-1212",
    "contactType": "Customer service"
  }
}
</script>
```
Another one is using the item attributes to provide the data in our HTML tag.
```html
<div itemscope itemtype ="http://schema.org/Movie">
  <h1 itemprop="name">Avatar</h1>
  <span>Director: <span itemprop="director">James Cameron</span> (born August 16, 1954)</span>
  <span itemprop="genre">Science fiction</span>
  <a href="../movies/avatar-theatrical-trailer.html" itemprop="trailer">Trailer</a>
</div>
```
We can check [schema.org](http://schema.org/docs/full.html) to know which data we should provide for our website. There are also some online generators we can use:
- [markup-helper](https://www.google.com/webmasters/markup-helper/u/0/)
- [json-ld-generator](https://hallanalysis.com/json-ld-generator/)  

After we add the structured data, don't forget to use the [structured data testing tool](https://search.google.com/structured-data/testing-tool/u/0/) to make sure everything is going well.
![data-schema](https://i.imgur.com/IU55vhy.png)


### 6. Error tracking service: Sentry, LogRocket, TRACKJS
It's almost impossible to create a website without any bugs. So when the bugs happen, we need to gain as much information as possible to make sure we can reproduce and fix it.
There are many services can help us track the bugs. Here are the services I have used before.
- [Sentry](https://sentry.io/)
- [LogRocket](https://logrocket.com/)
- [TRACKJS](https://trackjs.com/)  

To implement those services on our website is pretty intuitive. We can use their SDK or just paste the script them generate for us into our codebase.


### 7. lighthouse
Lighthouse analyzes our website in a few different factors. All of them are very important for SEO and user experience. So use the lighthouse to check our website, and base on the suggestions it provides, we can try to improve the score as much as possible to make sure we will have a good performance on SEO.
Lighthouse is integrated into Chrome dev-tools. We just have to click the `Audits` tab, select the device and other settings, then we can start analyzing our website.  
![lighthouse-audits](https://i.imgur.com/TcUwZC0.png)
Furthermore, make sure 
1. Test the production site, not the dev server. 
2. Use the Chrome incognito window to prevent the extensions and other settings affect the test result. 



---

## Conclusion
Create a website is not just finish all the features and fix the bugs. Except to learn the modern Javascript framework (React, Vue, Angular, Svelte..) and CSS. There are still tons of stuff we have to handle to master the front-end field. (exhausting but also a fun journey)
In this article, I only mention the most important part I think. So if you have your own pre-launch checklist which I didn't mention in this article. Or any feedback you want to share. Please feel free to leave a comment.
Thanks for reading.

--

## Reference
- [sitemap.xml](https://www.sitemaps.org/protocol.html)
- [robots.txt](https://support.google.com/webmasters/answer/6062596?hl=en)
- [Google Search Console](https://search.google.com/search-console/welcome)
- [Bing webmaster](https://www.bing.com/toolbox/webmaster)
- [Meta Tags](https://metatags.io/)
- [Facebook debug tools](https://developers.facebook.com/tools/debug/)
- [Twitter validator](https://cards-dev.twitter.com/validator)
- [Google Analytics](https://analytics.google.com/)
- [GTM](https://tagmanager.google.com/)
- [Hotjar](https://www.hotjar.com/)
- [JSON-LD](https://json-ld.org/)
- [schema.org](http://schema.org/docs/full.html)
- [markup-helper](https://www.google.com/webmasters/markup-helper/u/0/)
- [json-ld-generator](https://hallanalysis.com/json-ld-generator/)
- [structured data testing tool](https://search.google.com/structured-data/testing-tool/u/0/)
- [Sentry](https://sentry.io/)
- [LogRocket](https://logrocket.com/)
- [TRACKJS](https://trackjs.com/)