For the complete documentation index, see llms.txt. This page is also available as Markdown.

Analytics.click

Feature description

Leaves an analytics log when a touch or click occurs. Use it to record important user actions, such as clicking a purchase button. event to logs of the type event_type: 'click' The parameter is recorded together.

log_nameIf it is not specified, based on the current path <pathname>::click a name in the format is automatically used. In addition to the value you passed, the log parameters also automatically include the current page's query string (search), entrance path (referrer), deployment information (deployment_id, deployment_timestamp) is automatically included.

The current page URL is httpsIf it is not, the log is not sent.

Type

Analytics.click(params?: { log_name?: string } & { [key: string]: LogParam }): Promise<void> | undefined;

Params

// Keys other than log_name are also recorded as log parameters.
type LogParam = string | number | boolean | null | undefined;

Response

The current page URL is httpsIf it is not, the log is not sent and undefinedis returned.

Example code

JavaScript

import { Analytics } from "@apps-in-toss/web-framework";

const button = document.querySelector("#buy-button");

button.addEventListener("click", () => {
  Analytics.click({ log_name: "buy_button", text: "Buy" });
});

Was this helpful?