@masa-finance/analytics-react
Advanced tools
Comparing version 0.9.1 to 0.9.2
{ | ||
"name": "@masa-finance/analytics-react", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "A customizable, easy-to-use React component for displaying a cookie consent banner on your website, written in TypeScript.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -145,5 +145,6 @@ # Masa Analytics React | ||
- `user_address`: The users wallet address. | ||
- `network`: The blockchain network of the mint operation. | ||
- `contract_address`: The address of the contract of the mint operation. | ||
- `asset_amount`: Asset ammount | ||
- `network`: The blockchain network of the add liquidity operation. | ||
- `contract_address`: The address of the contract of the add liquidity operation. | ||
- `asset_amount`: The amount of the primary asset being added to the liquidity pool. | ||
- `asset_ticker`: The ticker of the primary asset being added to the liquidiy pool. | ||
@@ -172,3 +173,3 @@ #### Usage | ||
contract_address: contract_address, | ||
asset_amount: asset_amount | ||
asset_amount: asset_amount, | ||
asset_ticker: asset_ticker | ||
@@ -183,7 +184,6 @@ }); | ||
- `user_address`: The users wallet address. | ||
- `network`: The blockchain network of the mint operation. | ||
- `contract_address`: The address of the contract of the mint operation. | ||
- `token_name`: The token name of the contract of the mint operation. | ||
- `ticker`: The ticker of the contract of the mint operation. | ||
- `token_type`: The type of the contract of the mint operation. | ||
- `network`: The blockchain network of the farm operation. | ||
- `contract_address`: The address of the contract of the farm operation. | ||
- `asset_amount`: The amount of the primary asset being added to the farming pool. | ||
- `asset_ticker`: The ticker of the primary asset being added to the farming pool. | ||
@@ -211,3 +211,3 @@ #### Usage | ||
contract_address: contract_address, | ||
asset_amount: asset_amount | ||
asset_amount: asset_amount, | ||
asset_ticker: asset_ticker | ||
@@ -222,7 +222,6 @@ }); | ||
- `user_address`: The users wallet address. | ||
- `network`: The blockchain network of the mint operation. | ||
- `contract_address`: The address of the contract of the mint operation. | ||
- `token_name`: The token name of the contract of the mint operation. | ||
- `ticker`: The ticker of the contract of the mint operation. | ||
- `token_type`: The type of the contract of the mint operation. | ||
- `network`: The blockchain network of the swap operation. | ||
- `contract_address`: The address of the contract of the swap operation. | ||
- `asset_amount`: The amount of the primary asset being swapped. | ||
- `asset_ticker`: The ticker of the primary asset being swapped. | ||
@@ -251,3 +250,3 @@ #### Usage | ||
contract_address: contract_address, | ||
asset_amount: asset_amount | ||
asset_amount: asset_amount, | ||
asset_ticker: asset_ticker | ||
@@ -262,7 +261,6 @@ }); | ||
- `user_address`: The users wallet address. | ||
- `network`: The blockchain network of the mint operation. | ||
- `contract_address`: The address of the contract of the mint operation. | ||
- `token_name`: The token name of the contract of the mint operation. | ||
- `ticker`: The ticker of the contract of the mint operation. | ||
- `token_type`: The type of the contract of the mint operation. | ||
- `network`: The blockchain network of the bridge operation. | ||
- `contract_address`: The address of the contract of the bridge operation. | ||
- `asset_amount`: The amount of the primary asset being bridged. | ||
- `asset_ticker`: The ticker of the primary asset being bridged. | ||
@@ -301,7 +299,6 @@ #### Usage | ||
- `user_address`: The users wallet address. | ||
- `network`: The blockchain network of the mint operation. | ||
- `contract_address`: The address of the contract of the mint operation. | ||
- `token_name`: The token name of the contract of the mint operation. | ||
- `ticker`: The ticker of the contract of the mint operation. | ||
- `token_type`: The type of the contract of the mint operation. | ||
- `network`: The blockchain network of the trade operation. | ||
- `contract_address`: The address of the contract of the trade operation. | ||
- `asset_amount`: The amount of the primary asset being traded. | ||
- `asset_ticker`: The ticker of the primary asset being traded. | ||
@@ -340,7 +337,6 @@ #### Usage | ||
- `user_address`: The users wallet address. | ||
- `network`: The blockchain network of the mint operation. | ||
- `contract_address`: The address of the contract of the mint operation. | ||
- `token_name`: The token name of the contract of the mint operation. | ||
- `ticker`: The ticker of the contract of the mint operation. | ||
- `token_type`: The type of the contract of the mint operation. | ||
- `network`: The blockchain network of the claim operation. | ||
- `contract_address`: The address of the contract of the claim operation. | ||
- `asset_amount`: The amount of the asset being claimed. | ||
- `asset_ticker`: The ticker of the asset being claimed. | ||
@@ -369,3 +365,3 @@ #### Usage | ||
contract_address: contract_address, | ||
asset_amount: asset_amount | ||
asset_amount: asset_amount, | ||
asset_ticker: asset_ticker | ||
@@ -375,6 +371,39 @@ }); | ||
### Extending to Include Additional Event Data | ||
You can extend the tracking function to collect additional event data using the `additionalEventData` field as shown in this example. In this example we want to track and log the transaction hash and the protocol fee for making the swap so we can track swap revenue in Masa Analytics. `additionalEventData` can take any information you want to add for future reference or running custom analytics with Masa. | ||
These events can be used to monitor user interactions with your website, helping you make data-driven decisions and improve the user experience. | ||
```typescript | ||
import { useMasaAnalyticsReact } from "@masa-finance/analytics-react"; | ||
const { fireEvent } = useMasaAnalyticsReact({ | ||
clientApp: "My App", | ||
clientName: "My Company Name", | ||
clientId: '1234-5678-9012-4567' | ||
}); | ||
// Track a swap event with additional data | ||
const user_address = "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"; | ||
const network = "goerli"; | ||
const contract_address = "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"; | ||
const asset_amount = "1.20"; | ||
const asset_ticker = "ETH"; | ||
void fireEvent( "swap" , { | ||
user_address: user_address, | ||
network: network, | ||
contract_address: contract_address, | ||
asset_amount: asset_amount, | ||
asset_ticker: asset_ticker, | ||
additionalEventData: { | ||
transactionHash: "0x83138032f1e7bee64fccd15bbed403f6b875c47641f6b203cd59dfa9b7cf1b4a", | ||
fee: "0.12", | ||
fee_asset: "ETH" | ||
} | ||
}); | ||
``` | ||
These events can be used to monitor user interactions with your website and app, helping you make data-driven decisions and improve the user experience. | ||
## Installation | ||
@@ -381,0 +410,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68918
460