#3970 GA tracking for Neighborhood and projects

v1.0.0
closed
General
2015-08-20
2012-03-29
No

Gold-level neighborhoods and above should be able to enter a GA tracking ID for the neighborhood, and also for individual projects. Then use techniques documented at http://code.google.com/apis/analytics/docs/tracking/asyncUsageGuide.html#MultipleCommands to set up the JS to use those additional ids.

Discussion

  • Dave Brondsema

    Dave Brondsema - 2012-04-09
    • size: --> 4
     
  • Cory Johns - 2012-04-10
    • status: open --> in-progress
    • assigned_to: Cory Johns
     
  • Cory Johns - 2012-04-12

    forge:cj/3970
    sftheme:cj/3970

    I set up my own GA account and confirmed (eventually) that the hits are coming through, but I'm not sure how to test and confirm that the main account hits are still working as expected. Everything I could find in the docs, and the fact that the test account ones are working, make it seem like it should work fine, though.

     
  • Cory Johns - 2012-04-12
    • status: in-progress --> code-review
    • qa: Dave Brondsema!
     
  • Dave Brondsema

    Dave Brondsema - 2012-04-12
    • status: code-review --> open
     
  • Dave Brondsema

    Dave Brondsema - 2012-04-12

    Looks good. Would be a bit nicer to:

    • add an audit trail entry on the neighborhood field change
    • change the label to "Google Analytics ID" or something like that, so users know what its for
    • provide a simple implementation of custom_tracking_js in the base theme, that uses the project & nbhd settings too

    Blocked on:

    • determination about controlling which nbhds & projects should be able to set this
     
  • Dave Brondsema

    Dave Brondsema - 2012-04-12

    We should also remove the "user" custom field for additional profiles - we should not be sharing that data with others. Page type, project, and topic should be fine.

     
  • Cory Johns - 2012-04-13
    • status: open --> code-review
     
  • Dave Brondsema

    Dave Brondsema - 2012-04-17
    • status: code-review --> open
     
  • Dave Brondsema

    Dave Brondsema - 2012-04-17

    Got an error when saving the neighborhood tracking id. We should have a test that covers this.

    File '/home/dbrondsema/dbrondsema-7024/forge/Allura/allura/controllers/project.py', line 463 in update
      M.AuditLog.log('update neighborhood tracking_id')
    File '/home/dbrondsema/dbrondsema-7024/forge/Allura/allura/model/auth.py', line 625 in log
      return cls(project_id=project._id, user_id=user._id, url=url, message=message)
    AttributeError: 'NoneType' object has no attribute '_id'
    

    And the _setCustomVar for userid needs to come before the _track* items in gaq.push. GA recommends this - see point 3 on http://code.google.com/apis/analytics/docs/tracking/gaTrackingCustomVariables.html#recommended

     
  • Cory Johns - 2012-04-18
    • status: open --> in-progress
     
  • Cory Johns - 2012-04-20

    allura:cj/3970
    sftheme:cj/3970

     
  • Cory Johns - 2012-04-20
    • status: in-progress --> code-review
     
  • Dave Brondsema

    Dave Brondsema - 2012-04-23

    So, after all the hoopla about c.project being set, it looks like the audit log needs to have the project_id be the --init-- project id. Otherwise it doesn't show up on /p/admin/audit/ Maybe AuditLog.log can look for c.neighborhood when c.project isn't set?

     
  • Dave Brondsema

    Dave Brondsema - 2012-04-23
    • status: code-review --> in-progress
     
  • Cory Johns - 2012-04-24
    • status: in-progress --> code-review
     
  • Cory Johns - 2012-04-24

    Changed to use self.neighborhood.neighborhood_project instead of None

     
  • Dave Brondsema

    Dave Brondsema - 2012-04-24
    • status: code-review --> blocked
     
  • Dave Brondsema

    Dave Brondsema - 2012-04-24

    Good, but want to get [#4056] merged, and hook it up as a flag.

     

    Related

    Tickets: #4056

  • Dave Brondsema

    Dave Brondsema - 2012-04-26
    • status: blocked --> closed
     

Log in to post a comment.