Follow the steps below to add your Visiopt UniversalSmart Code to your NextJS project.
Step-by-Step Instructions
| 1 | Log in to your Visiopt account at app.visiopt.com. |
| 2 | Navigate to Settings → Manage Your Domain from the top navigation menu. |
| 3 | Click on the "Add New Domain" button to begin adding your website. |
| 4 | Fill in the required details: • Website Name — Enter a name for your website. • Website URL — Enter the full URL of your website (e.g., https://yourwebsite.com). • Frontend Framework — Select "NextJS" from the dropdown list. Then click Save to proceed. |
| 5 | After saving, Visiopt will generate your unique UniversalSmart Code for your Next domain. Copy this code snippet.
|
| 6 | Open your NextJS project in your code editor. |
| 7 | Locate the layout.tsx file inside the app/ folder of your project: your-next-app/ └── app/ └── layout.tsx ← Add the code here |
| 8 | Paste the UniversalSmart Code inside the <head> tag of your layout.tsx file, as shown below: |
return ( <html lang="en"> <head> // Paste your Visiopt UniversalSmart Code here </head> <body> <Navbar /> <main>{children}</main> <Footer /> </body> </html> )
|
| 9 | Save the layout.tsx file and restart your Next development server if it is running. |
| 📌 Note: The UniversalSmart Code must be placed inside the <head> section to ensure it loads on every page of your Next application correctly. |
Comments
0 comments
Please sign in to leave a comment.