sfchronicle / pillars-among-the-ruins

Last Men Standing
http://projects.sfchronicle.com/2016/living-with-aids/
0 stars 0 forks source link

Adding analytics for project #49

Closed aboutaaron closed 8 years ago

aboutaaron commented 8 years ago

Aaron,

To start with, let's emulate the "data layer" implemented on the WCM pages. This uses a series of global JS variables defined in an inline script placed in the . Hearst Corp.'s data science team has a custom analytics solution deployed internationally that feeds data to some internal tools. I think using existing variables will make your "projects" pages compatible with that system without requiring extra development work.

At some point, we'll probably move to storing the data layer inside a JS object; I'll keep you updated on those efforts.

The variables to add are:

omni_channelPath
omni_title
omni_className
omni_publicationDate
omni_authorName
omni_authorTitle

(See details below.)

Note that these need to be defined before the Ensighten Bootstrap.js script loads.

omni_channelPath

This is the site section hierarchy, which can run up to three levels deep. Follow the WCM channel hierarchy for reference. If there is more than one section, use " :: " -- one space, two colons, one space -- as a delimeter. Examples:

var omni_channelPath = "News";
var omni_channelPath = "News :: Special Projects";

omni_title

The headline, or name of the page. You can even set it to document.title so long as there are no extraneous elements such as the name of the paper. Example:

var omni_title = "2015 Voter Guide";

omni_className

Set to "channel" if an index page, "article" if it's a content page. If you have content that maps logically to some other standard content types in Omniture, we can discuss. Examples:

var omni_className = "channel";

omni_publicationDate

The timestamp that the page was originally published/posted. Format: "yyyy-mm-dd hh:mm:ss". Example:

var omni_publicationDate = "2015-11-18 00:01:15";

omni_authorName

The byline. "By " may be excluded; it should be stripped out anyway. Example:

var omni_authorName = "By JANE DOE";
var omni_authorName = "John Smith and Jane Doe";

omni_authorTitle

Title(s) for the author(s). Example:

var omni_authorTitle = "San Francisco Chronicle staff"

So, a complete "omni" variable block would look something like:

<script type="text/javascript">
var omni_channelPath = "News :: Special Projects";
var omni_title = "2015 Voter Guide";
var omni_className = "channel";
var omni_publicationDate = "2015-11-01 00:01:00";
var omni_authorName = "By JANE DOE";
var omni_authorTitle = "San Francisco Chronicle staff";
</script>

Can you get these variables onto the pages for the AIDS project? Also, if you want to put them onto pages already published on the projects server, I can start testing.

It's possible I may need to add another variable or two as well after testing.