I’m building an AJAX based portfolio module using pushState / hash bangs and as I’m ruling out browsers without JavaScript the only thing that concerns me is how limited the HTML custom data attributes are when it comes to SEO.
For example, using the code below:
<ul class="gallery" data-anchor="/photography/example/" data-title="Example"></ul>
Will the data-title be indexed, i.e. will that text content be gathered by Google? Or would I need to include a header tag in or around the list as a descriptive complement? The data-title is meant to be used as a new window title once the user clicks on that particular gallery.
No, it won’t be indexed. The attribute itself will be cached with the page, but Google has no context of what the attribute or the value means, so it is meaningless to search engines.