add a box on the post/page editor for optional "name" and "category" so if the post title is "10 Simple SEO Tips" but they enter "SEO Tips" into the post name and "Marketing" into the category, then when someone views the page fire this track call:
analytics.track('Viewed Post', {
title: '10 Simple SEO Tips',
name: 'SEO Tips',
category: 'Marketing',
noninteraction: true
});
If they don't enter anything then the title and name will be the same and the category will pull from the category or categories that the post belongs to, so if the post belongs to the Marketing and SEO categories:
analytics.track('Viewed Post', {
title: '10 Simple SEO Tips',
name: '10 Simple SEO Tips',
category: 'Marketing, SEO',
noninteraction: true
});
Pages will be done in a similar way...
If a page name and category are defined in the page editor page:
analytics.track('Viewed {{page.name}} Page, {
title: {{page.title}}, // the full title of the page
url: 'https://segment.io/team',
path: '/team',
referrer: 'https://segment.io/',
name: {{page.name}} || {{page.title}},
category: {{page.category}}, // null if not specified
noninteraction: true
});
@ianstormtaylor does this all look ok to you?