Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Lin-jun-xiang committed Sep 22, 2023
1 parent 629f12a commit e85aa41
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 30 deletions.
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
- [How to Stream GA4 Data to Bigquery in Real-time?](#how-to-stream-ga4-data-to-bigquery-in-real-time)
- [Features](#features)
- [How to Use?](#how-to-use)
- [Download the Package](#download-the-package)
- [Connect to Your Bigquery](#connect-to-your-bigquery)
- [Connect to GA4 Tables](#connect-to-ga4-tables)
- [Evaluate Query Cost with dry run](#evaluate-query-cost-with-dry-run)
- [Analyze User Properties](#analyze-user-properties)
- [Analyze Device Properties](#analyze-device-properties)
- [Analyze Events](#analyze-events)
- [Download the Package](#download-the-package)
- [Connect to Your Bigquery](#connect-to-your-bigquery)
- [Connect to GA4 Tables](#connect-to-ga4-tables)
- [Evaluate Query Cost with dry run](#evaluate-query-cost-with-dry-run)
- [Analyze User Properties](#analyze-user-properties)
- [Analyze Device Properties](#analyze-device-properties)
- [Analyze Events](#analyze-events)

---

Expand Down Expand Up @@ -52,11 +52,13 @@ If successful, you will see tables in Bigquery similar to the following (`analyt

For more features, please refer to the [package documentation](https://lin-jun-xiang.github.io/pyga4/).

#### Download the Package
### Download the Package

`pip install pyga4`
```
pip install pyga4
```

#### Connect to Your Bigquery
### Connect to Your Bigquery
```python
from google.cloud import bigquery

Expand All @@ -67,7 +69,7 @@ client = bigquery.Client()
# )
```

#### Connect to GA4 Tables
### Connect to GA4 Tables
```python
from pyga4.model import Ga4Table

Expand All @@ -82,7 +84,7 @@ print(table_id_list)
ga4_table.table_id = 'events_intraday_20200812'
```

#### Evaluate Query Cost with dry run
### Evaluate Query Cost with dry run
```python
# Query with dry run:
ga4_table.query_config.dry_run = True
Expand All @@ -92,7 +94,7 @@ ga4_table.table_id = 'events_intraday_20200812'
results = ga4_table.query(query) # return None, but you can see the query usage!
```

#### Analyze User Properties
### Analyze User Properties

**Query User ID and Country List**

Expand All @@ -113,15 +115,15 @@ countries_dist = user_analytic.countries_distribution
userid_dist = user_analytic.user_id_distribution
```

#### Analyze Device Properties
### Analyze Device Properties

```python
# DeviceAnalytic
device_analytic = DeviceAnalytic(ga4_table)
mobile_brand_dist = device_analytic.mobile_brand_distribution
```

#### Analyze Events
### Analyze Events

```python
# EventAnalytic
Expand Down
32 changes: 17 additions & 15 deletions README.zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
- [如何將 GA4 數據實時串流到 Bigquery?](#如何將-ga4-數據實時串流到-bigquery)
- [功能](#功能)
- [如何使用?](#如何使用)
- [下載套件](#下載套件)
- [連接您的 Bigquery](#連接您的-bigquery)
- [連接 GA4 資料表](#連接-ga4-資料表)
- [使用 dry run 評估查詢費用](#使用-dry-run-評估查詢費用)
- [分析使用者屬性](#分析使用者屬性)
- [分析裝置屬性](#分析裝置屬性)
- [分析事件](#分析事件)
- [下載套件](#下載套件)
- [連接您的 Bigquery](#連接您的-bigquery)
- [連接 GA4 資料表](#連接-ga4-資料表)
- [使用 dry run 評估查詢費用](#使用-dry-run-評估查詢費用)
- [分析使用者屬性](#分析使用者屬性)
- [分析裝置屬性](#分析裝置屬性)
- [分析事件](#分析事件)

---

Expand Down Expand Up @@ -51,11 +51,13 @@

更多功能,請參考[套件說明檔](https://lin-jun-xiang.github.io/pyga4/)

#### 下載套件
### 下載套件

`pip install pyga4`
```
pip install pyga4
```

#### 連接您的 Bigquery
### 連接您的 Bigquery
```python
from google.cloud import bigquery

Expand All @@ -66,7 +68,7 @@ client = bigquery.Client()
# )
```

#### 連接 GA4 資料表
### 連接 GA4 資料表
```python
from pyga4.model import Ga4Table

Expand All @@ -81,7 +83,7 @@ print(table_id_list)
ga4_table.table_id = 'events_intraday_20200812'
```

#### 使用 dry run 評估查詢費用
### 使用 dry run 評估查詢費用

```python
# Query with dry run:
Expand All @@ -92,7 +94,7 @@ ga4_table.table_id = 'events_intraday_20200812'
results = ga4_table.query(query) # return None, but you can see the query usage!
```

#### 分析使用者屬性
### 分析使用者屬性

**查詢使用者id、國家列表**

Expand All @@ -113,15 +115,15 @@ countries_dist = user_analytic.countries_distribution
userid_dist = user_analytic.user_id_distribution
```

#### 分析裝置屬性
### 分析裝置屬性

```python
# DeviceAnalytic
device_analytic = DeviceAnalytic(ga4_table)
mobile_brand_dist = device_analytic.mobile_brand_distribution
```

#### 分析事件
### 分析事件

```python
# EventAnalytic
Expand Down

0 comments on commit e85aa41

Please sign in to comment.