Skip to content

Add PostHog action of User_Register

Baodong请求将add-posthog-event-register合并到main-jh

Related issue link: https://jihulab.com/gitlab-cn/gitlab/-/issues/1359

Rollout issue link: https://jihulab.com/gitlab-cn/gitlab/-/issues/1658

What does this MR do and why?

Add PostHog action of User_Register

When Action Category URL
Request register form User_Register Register_Submit http://localhost:3000/users/sign_up
Render welcome page after register User_Register Welcome_Page http://localhost:3000/users/sign_up/welcome

This function is controlled by feature flag of posthog_register_event and is enabled by default.

This function is only for JiHu SaaS.

Screenshots

Register_Submit Welcome_Page
Register_Submit Welcome_Page

Register_Submit#User_Register

{
    "id": "0182a456-65f2-0000-d7c7-007f661e82f2",
    "timestamp": "2022-08-16T01:48:18.512000+00:00",
    "event": "Register_Submit#User_Register",
    "distinct_id": "feb17868-d0f6-4f01-bf40-8f2c3c669ad8",
    "properties": {
        "$geoip_city_name": "Yuen Long San Hui",
        "$geoip_continent_code": "AS",
        "$geoip_continent_name": "Asia",
        "$geoip_country_code": "HK",
        "$geoip_country_name": "Hong Kong",
        "$geoip_latitude": 22.4362,
        "$geoip_longitude": 114.0345,
        "$geoip_subdivision_1_code": "NYL",
        "$geoip_subdivision_1_name": "Yuen Long District",
        "$geoip_time_zone": "Asia/Hong_Kong",
        "$ip": "155.137.193.116",
        "$lib": "posthog-ruby",
        "$lib_version": "1.3.0",
        "$plugins_deferred": [],
        "$plugins_failed": [],
        "$plugins_succeeded": [
            "GeoIP (8008)"
        ],
        "$set": {
            "$geoip_city_name": "Yuen Long San Hui",
            "$geoip_country_name": "Hong Kong",
            "$geoip_country_code": "HK",
            "$geoip_continent_name": "Asia",
            "$geoip_continent_code": "AS",
            "$geoip_postal_code": null,
            "$geoip_latitude": 22.4362,
            "$geoip_longitude": 114.0345,
            "$geoip_time_zone": "Asia/Hong_Kong",
            "$geoip_subdivision_1_code": "NYL",
            "$geoip_subdivision_1_name": "Yuen Long District"
        },
        "$set_once": {
            "$initial_geoip_city_name": "Yuen Long San Hui",
            "$initial_geoip_country_name": "Hong Kong",
            "$initial_geoip_country_code": "HK",
            "$initial_geoip_continent_name": "Asia",
            "$initial_geoip_continent_code": "AS",
            "$initial_geoip_postal_code": null,
            "$initial_geoip_latitude": 22.4362,
            "$initial_geoip_longitude": 114.0345,
            "$initial_geoip_time_zone": "Asia/Hong_Kong",
            "$initial_geoip_subdivision_1_code": "NYL",
            "$initial_geoip_subdivision_1_name": "Yuen Long District"
        },
        "action": "User_Register",
        "category": "Register_Submit",
        "context": {
            "schema": "iglu:com.gitlab/gitlab_standard/jsonschema/1-0-8",
            "data": {
                "environment": "development",
                "source": "gitlab-rails",
                "plan": null,
                "extra": {
                    "username": "cbd3",
                    "email": "cbd3@gmail.com",
                    "first_name": "bd",
                    "last_name": "c"
                },
                "user_id": null,
                "namespace_id": null,
                "project_id": null,
                "context_generated_at": "2022-08-16 01:48:18 UTC"
            }
        },
        "label": null,
        "property": null,
        "value": null
    },
    "elements_chain": ""
}

Welcome_Page#User_Register

{
    "id": "0182a451-0cf4-0000-6fbe-c9acb09dd39d",
    "timestamp": "2022-08-16T01:42:27.192000+00:00",
    "event": "Welcome_Page#User_Register",
    "distinct_id": "104",
    "properties": {
        "$geoip_city_name": "Yuen Long San Hui",
        "$geoip_continent_code": "AS",
        "$geoip_continent_name": "Asia",
        "$geoip_country_code": "HK",
        "$geoip_country_name": "Hong Kong",
        "$geoip_latitude": 22.4362,
        "$geoip_longitude": 114.0345,
        "$geoip_subdivision_1_code": "NYL",
        "$geoip_subdivision_1_name": "Yuen Long District",
        "$geoip_time_zone": "Asia/Hong_Kong",
        "$ip": "155.137.193.116",
        "$lib": "posthog-ruby",
        "$lib_version": "1.3.0",
        "$plugins_deferred": [],
        "$plugins_failed": [],
        "$plugins_succeeded": [
            "GeoIP (8008)"
        ],
        "$set": {
            "$geoip_city_name": "Yuen Long San Hui",
            "$geoip_country_name": "Hong Kong",
            "$geoip_country_code": "HK",
            "$geoip_continent_name": "Asia",
            "$geoip_continent_code": "AS",
            "$geoip_postal_code": null,
            "$geoip_latitude": 22.4362,
            "$geoip_longitude": 114.0345,
            "$geoip_time_zone": "Asia/Hong_Kong",
            "$geoip_subdivision_1_code": "NYL",
            "$geoip_subdivision_1_name": "Yuen Long District"
        },
        "$set_once": {
            "$initial_geoip_city_name": "Yuen Long San Hui",
            "$initial_geoip_country_name": "Hong Kong",
            "$initial_geoip_country_code": "HK",
            "$initial_geoip_continent_name": "Asia",
            "$initial_geoip_continent_code": "AS",
            "$initial_geoip_postal_code": null,
            "$initial_geoip_latitude": 22.4362,
            "$initial_geoip_longitude": 114.0345,
            "$initial_geoip_time_zone": "Asia/Hong_Kong",
            "$initial_geoip_subdivision_1_code": "NYL",
            "$initial_geoip_subdivision_1_name": "Yuen Long District"
        },
        "action": "User_Register",
        "category": "Welcome_Page",
        "context": {
            "schema": "iglu:com.gitlab/gitlab_standard/jsonschema/1-0-8",
            "data": {
                "environment": "development",
                "source": "gitlab-rails",
                "plan": null,
                "extra": {
                    "email": "cbd2@gmail.com"
                },
                "user_id": 104,
                "namespace_id": null,
                "project_id": null,
                "context_generated_at": "2022-08-16 01:42:27 UTC"
            }
        },
        "label": null,
        "property": null,
        "value": null
    },
    "elements_chain": ""
}

cc EM @prajnamas

Baodong 编辑于

合并请求报告

加载中