def test_screen(self): analytics.screen('userId') analytics.flush()
def screen(): analytics.screen(options.userId, name=options.name, anonymous_id=options.anonymousId, properties=json_hash(options.properties), context=json_hash(options.context))
def test_screen(self): analytics.screen('distinct_id') analytics.flush()
integrations = arguments["--integrations"] if integrations: integrations = json.loads(integrations) msgType = arguments["--type"] if msgType == "track": properties = arguments["--properties"] if properties: properties = json.loads(properties) analytics.track(user_id = userId, anonymous_id=anonymousId, event = arguments["--event"], properties = properties, context = context, integrations = integrations) elif msgType == "screen": properties = arguments["--properties"] if properties: properties = json.loads(properties) analytics.screen(user_id = userId, anonymous_id=anonymousId, name = arguments["--name"], properties = properties, context = context, integrations = integrations) elif msgType == "page": properties = arguments["--properties"] if properties: properties = json.loads(properties) analytics.page(user_id = userId, anonymous_id=anonymousId, name = arguments["--name"], properties = properties, context = context, integrations = integrations) elif msgType == "alias": analytics.alias(user_id = userId, previousId=arguments["--previousId"]) elif msgType == "group": traits = arguments["--traits"] if traits: traits = json.loads(traits) analytics.group(user_id = userId, anonymous_id=anonymousId, group_id = arguments["--groupId"], traits = traits, context = context, integrations = integrations) elif msgType == "identify": traits = arguments["--traits"] if traits:
def screen(): analytics.screen(options.userId, name = options.name, anonymous_id = options.anonymousId, properties = json_hash(options.properties), context = json_hash(options.context))