Skip to content

Commit

Permalink
adds SEO metadata to HTML and adds GTM
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Pond authored and Ryan Pond committed Feb 18, 2024
1 parent 21f6192 commit a2eecb0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 48 deletions.
26 changes: 24 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,35 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AgeWise - Chronic Pain Guide</title>
<link rel="stylesheet" href="style.css">
<meta name="description" content="Discover AgeWise by Next Level PT, an innovative chatbot designed to help individuals over 40 understand and manage chronic pain through personalized advice and educational insights.">
<meta property="og:title" content="AgeWise - Chronic Pain Guide">
<meta property="og:description" content="AgeWise by Next Level PT: Empower your journey towards pain-free living with our AI-driven chatbot, offering personalized guidance and solutions for chronic pain management.">
<meta property="og:image" content="/favicon.svg">
<meta property="og:url" content="https://agewise.nextlevelpthouston.com">
<meta name="twitter:title" content="AgeWise - Chronic Pain Guide">
<meta name="twitter:description" content="AgeWise by Next Level PT: Empower your journey towards pain-free living with our AI-driven chatbot, offering personalized guidance and solutions for chronic pain management.">
<meta name="twitter:image" content="/favicon.svg">
<link rel="stylesheet" href="/style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Kaushan+Script&family=Roboto+Condensed:wght@800&display=swap" rel="stylesheet">
<link rel="icon" href="favicon.svg" type="image/svg+xml">

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-MFGRC58B');</script>
<!-- End Google Tag Manager -->

</head>
<body>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MFGRC58B"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

<div class="headerContent">
<h1 class="heading" id="title"><span id="age">AGE</span><span id="wise">Wise</span><span id="trademark"></span></h1>
<h2 class="heading" id="subtitle">An Interactive Guide to Understanding Your Chronic Pain</h2>
Expand Down Expand Up @@ -79,6 +101,6 @@ <h1 id="contactUsHeader">Contact Us</h1>
</div> -->


<script src="index.js"></script>
<script src="./index.js"></script>
</body>
</html>
1 change: 0 additions & 1 deletion public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
--nlpt-gray: #BFB4B0;
}


body {
margin: 0;
padding: 0;
Expand Down
46 changes: 1 addition & 45 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const pool = mysql.createPool({

const express = require('express')
const app = express()

app.use(express.static('public'))
app.use(express.json())

// Start the server
Expand Down Expand Up @@ -53,50 +53,6 @@ app.post('/submit-user-info', async (req, res) => {
}
})

// Set up a route to serve the HTML content with the injected variables
app.get('/', (req, res) => {
const gtag = process.env.GTAG

const bodyContent = `
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=${gtag}"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
`

const injectedScripts = `
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','${gtag}');</script>
<!-- End Google Tag Manager -->
`

const htmlContent = `
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AgeWise - Chronic Pain Guide</title>
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Kaushan+Script&family=Roboto+Condensed:wght@800&display=swap" rel="stylesheet">
<link rel="icon" href="favicon.svg" type="image/svg+xml">
${injectedScripts}
</head>
<body>
${bodyContent}
</body>
</html>
`

res.send(htmlContent)
})

const OpenAI = require('openai')

const openai = new OpenAI({
Expand Down

0 comments on commit a2eecb0

Please sign in to comment.