Skip to content

Instantly share code, notes, and snippets.

@Jayphen
Created April 13, 2012 07:59
Show Gist options
  • Save Jayphen/2374987 to your computer and use it in GitHub Desktop.
Save Jayphen/2374987 to your computer and use it in GitHub Desktop.
Yield custom trackPageview parameters for Google Analytics
-if content_for?(:track_page_view)
="_gaq.push(['_trackPageview', #{yield(:track_page_view).gsub(/\s+/, '')} ]);"
-else
_gaq.push(['_trackPageview']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment