I am really at my wits end with seo on a web site. I started working on something and i always thought that build:ssr is generating a site that is google index friendly. Actually build:ssr was not doing anything else than the classic ng build from angular was doing.
After seeing that google is not indexing anything else but my first page I started looking into options.
I tried scully io but i can't make routing work with this. Either i have to useHash or i get problems with page refresh even if i set a htaccess. Even with useHash , on refresh the website keeps going through home to get back to where it was.
Now angular universal prerender makes what it says. It prerenders my website which is nice, it also has options for routes.txt for dynamic routes which is everything I needed.
It's just that my meta tags are not working anymore.
this.meta.updateTag({
name: 'description',
content: this.pageTitle,
});
this.meta.updateTag({
name: 'keywords',
content: this.pageTitle,
});
Either it's updateTag, addTag etc nothing works.
I searched all google upside down. I tried with chatGPT but no use.. 50% of it's responses are wrong or with missing info.
I can't believe there is no one else that tried angular universal prerender and didn't have troubles setting and updating meta tags in it's app.
I set the meta tags on ngInit, i see them with element inspector but when looking at the page source , they are nowhere to be found. If i look on how google is indexing pages and request an index.. i see what he sees. A page without meta tags.
The alternative is to start all over with next.js which is new to me.
"dependencies": {
"@angular/animations": "^15.2.3",
"@angular/common": "^15.2.3",
"@angular/compiler": "^15.2.3",
"@angular/core": "^15.2.3",
"@angular/forms": "^15.2.3",
"@angular/localize": "^15.2.3",
"@angular/platform-browser": "^15.2.3",
"@angular/platform-browser-dynamic": "^15.2.3",
"@angular/platform-server": "15.2.3",
"@angular/router": "^15.2.3",
"@ng-bootstrap/ng-bootstrap": "^14.0.0",
"@nguniversal/express-engine": "^15.2.0",
"@popperjs/core": "^2.10.2",
"bootstrap": "^5.2.3",
"bootstrap-icons": "^1.10.3",
"express": "^4.15.2",
"jquery": "^3.6.3",
"lightbox2": "^2.11.3",
"ng-lazyload-image": "^9.1.3",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^15.2.4",
"@angular/cli": "~15.2.4",
"@angular/compiler-cli": "^15.2.3",
"@nguniversal/builders": "^15.2.0",
"@types/express": "^4.17.0",
"@types/jasmine": "~4.0.0",
"@types/node": "^14.15.0",
"jasmine-core": "~4.1.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "^4.9.5"
}
}
I tried everyhting on the internet and nothing works, my angular universal prerender is not generating meta tags