javascripthtmlseogooglebotdynamic-text

Getting dynamic text indexed by Google


Seems like this should be a common problem, but I can't seem to find it discussed anywhere.

I'm working on a an interactive map - i.e. when you click on one of the markers, it brings up some descriptive text about that location. And I would like to make sure this text gets indexed by Google.

Currently, I'm storing all of these texts in an array, hardcoded in the script. And when someone clicks on a marker, I load the text for that marker into the DOM. The problem is Googlebot just sees it as code and does not index it.

One possible solution I thought of is to store the text in the HTML rather than as an array. But it seems a bit silly to add a bunch of invisible elements, and I'm also afraid that Google may see it as cloaking.

Any thoughts on how I can get Google to index the text?


Solution