https://github.com/zunda-pixel/googleanalytics-swift
Google Analytics REST API Client for Swift
https://github.com/zunda-pixel/googleanalytics-swift
google googleanalytics swift
Last synced: about 2 months ago
JSON representation
Google Analytics REST API Client for Swift
- Host: GitHub
- URL: https://github.com/zunda-pixel/googleanalytics-swift
- Owner: zunda-pixel
- License: apache-2.0
- Created: 2025-02-04T06:01:09.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-18T00:36:09.000Z (about 1 year ago)
- Last Synced: 2025-02-18T01:27:22.019Z (about 1 year ago)
- Topics: google, googleanalytics, swift
- Language: Swift
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## GoogleAnalytics Measurement Protocol for Swift
[](https://swiftpackageindex.com/zunda-pixel/googleanalytics-swift)
[](https://swiftpackageindex.com/zunda-pixel/googleanalytics-swift)
[GA4 Measurement Protocol](https://developers.google.com/analytics/devguides/collection/protocol/ga4)
```swift
let client = GoogleAnalytics(
httpClient: .urlSession(.shared),
apiSecret: "bCab-SdfDBi2L3ZPaYHYfw",
id: .firebase(
firebaseAppId: "1:211175559289:ios:121555f3c816aecc3cd5d8",
appInstanceId: UUID().uuidString.replacingOccurrences(of: "-", with: "")
)
)
let sessionId = UUID().uuidString.replacingOccurrences(of: "-", with: "")
try await client.send(for: .login(
method: "Email",
sessionId: sessionId,
engagementTime: 123
))
```