Added some code to support Google's conversion tracking.
This commit is contained in:
parent
46b888f514
commit
c31856b40b
|
@ -79,6 +79,14 @@ class Notebooks( object ):
|
|||
if revision:
|
||||
result[ "note_read_write" ] = False
|
||||
|
||||
# if the user doesn't have any storage bytes yet, they're a new user, so see what type of
|
||||
# conversion this is (demo or signup)
|
||||
if result[ "user" ].storage_bytes == 0:
|
||||
if u"demo" in [ note.title for note in result[ "startup_notes" ] ]:
|
||||
result[ "conversion" ] = u"demo"
|
||||
else:
|
||||
result[ "conversion" ] = u"signup"
|
||||
|
||||
return result
|
||||
|
||||
def contents( self, notebook_id, note_id = None, revision = None, user_id = None ):
|
||||
|
|
|
@ -26,6 +26,7 @@ class Main_page( Page ):
|
|||
start = None,
|
||||
count = None,
|
||||
http_url = None,
|
||||
conversion = None,
|
||||
):
|
||||
startup_note_ids = [ startup_note.object_id for startup_note in startup_notes ]
|
||||
|
||||
|
@ -74,6 +75,14 @@ class Main_page( Page ):
|
|||
else:
|
||||
notebook_path = u"/notebooks/%s" % notebook.object_id
|
||||
|
||||
conversion_html = None
|
||||
|
||||
if conversion:
|
||||
try:
|
||||
conversion_html = file( u"static/html/%s_conversion.html" % conversion ).read()
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
Page.__init__(
|
||||
self,
|
||||
title,
|
||||
|
@ -165,6 +174,10 @@ class Main_page( Page ):
|
|||
),
|
||||
id = u"center_area",
|
||||
),
|
||||
Div(
|
||||
conversion_html,
|
||||
id = u"conversion_area",
|
||||
),
|
||||
id = u"everything_area",
|
||||
),
|
||||
)
|
||||
|
|
|
@ -20,6 +20,7 @@ class Notebook_rss( Rss_channel ):
|
|||
start = None,
|
||||
count = None,
|
||||
http_url = u"",
|
||||
conversion = None,
|
||||
):
|
||||
if notebook.name == u"Luminotes":
|
||||
notebook_path = u"/"
|
||||
|
|
Reference in New Issue