concord-consortium/lab — pull request #26 by tdyer (2013-04-12 15:13:21+00:00)
Title: Track GA pageviews after the interactive is loaded with ajax

This is a fix for how the page title gets reported to GA. See PT bug https://www.pivotaltracker.com/s/projects/731349/stories/47976947

From this PT bug:
Currently two page titles are reported to GA for each interactive viewed. This is because the html page for interactives sets the title on page load then this title is changed to the title of a specific interactive after it is loaded by ajax.

Currently, the GA reports for interactives filter out the titles set by the html files. For embedded interactives this title is "Simple Atoms Interactive Model" set in server/public/examples/interactives/embeddable.html. Non embedded interactives title is "Interactive Browser" set in server/public/examples/interactives/interactives.html

The fix is to move the code that reports to GA to the handler/callback thats invoked after the interactive is loaded via ajax.