javascript - Google Search Console Intermittently Not Rendering title and description - AngularJS -


google crawling pages without error, failing - @ least - render title , description meta content. out of ~1300 pages, says have ~300 duplicate meta content. when look, duplicates {{metacontent}}.

when check pages site:url, on pages, see title , description. on other pages, see curly braces. google's documentation suggests pretty @ handling javascript, , figured angularjs should in wheelhouse.

i'm using angular v1.5.5 , ngroute routing. i've moved time-consuming api calls route resolve this:

$routeprovider.when('/route', {    templateurl: 'sometemplate',    controller: 'somecontroller',    resolve: {stuffineed: function () {return service.getstuff()}} }) 

my html in root scope looks this:

<title ng-bind-template="{{title}}"></title> <meta name="description" content="{{metadescription}}" />

then in controllers, doing:

$rootscope.title = 'something' $rootscope.metadescription = 'something'

my next attempt improve things not pass $rootscope controllers @ , instead listen "$routechangesuccess" in app.run this: $rootscope.$on( "$routechangesuccess", function(event, next, current) , set title , metadescription on root scope.

update:

i've updated on route change success improvement, still have duplicate meta content. exact, have 400 duplicates out of ~50k indexed pages. it's boilerplate below. when navigate page , inspect, see expect. maybe angular not right tool job -- want make google seo happy. hunch if page doesn't render inside of time threshold, google won't updated title , meta content.

app.run(function($rootscope) { $rootscope.title = boilerplate $rootscope.metadescription = boilerplate $rootscope.$on('$routechangesuccess', function(event, next, current) { $rootscope.title = realtitle $rootscope.metadescription = realdescription }) })

thanks reading!


Comments