threshold-network / website

1 stars 10 forks source link

Modify the autocapture events for specific buttons #70

Closed michalsmiarowski closed 1 year ago

michalsmiarowski commented 1 year ago

Ref: https://github.com/threshold-network/token-dashboard/issues/479

Modify the autocapture events for posthog for specific buttons. We want to track how many users clicked the "Mint tBTC" button from main page, "Learn more" from tBTC section on main page and "Mint tbtc" button from "/earn/btc" page. For that we are using specific attribute that allow us to add additional properties to the autocapture event:

data-ph-capture-attribute-{property-name}={value}

We use button-name as a property name and ${buttonName} ${currentUrl}. I've added the currentUrl to the value so we can differentiate the "Mint tbtc" button from main page from the one from "eart/btc" page.

Thanks to that we can use filter in the PostHog dashboard to filter out those specific button. We could use that to count how many users clicked on that specific button.

github-actions[bot] commented 1 year ago

Preview uploaded to https://preview.threshold.network/posthog-improvements/index.html.

github-actions[bot] commented 1 year ago

Preview uploaded to https://preview.threshold.network/posthog-improvements/index.html.

github-actions[bot] commented 1 year ago

Preview uploaded to https://preview.threshold.network/posthog-improvements/index.html.