---
updatedAt: 2026-07-27T10:13:13.000Z
agentTools:
  projectIndex: https://developers.dailymotion.com/v0/llms.txt
---

# Google Analytics 4 (iOS)

Dailymotion currently supports client-side integration with Google Analytics. It allows **collecting client-side events from iOS apps and send them to a Google Analytics account** for further storage and analysis.

# Implementation steps

<br />

## 1. Add the Analytics SDK to your app

Use Swift Package Manager to install and manage Firebase dependencies:

1. In Xcode, with your app project open, navigate to **File > Add Packages**.
2. When prompted, add the Firebase Apple platforms SDK repository: `https://github.com/firebase/firebase-ios-sdk.git`

<Image src="https://files.readme.io/aef6dd1158e61e0b916afb8a0901b5043527452f3574fcd1f3adc34e4adb7809-GA4-iOS-1-1024x573.png" align="center" />

Learn more about <Anchor target="_blank" href="https://firebase.google.com/docs/analytics/get-started?platform=ios">adding Firebase to your project</Anchor>.

<br />

## 2. Initiate the Firebase SDK

Import the `FirebaseCore` module in your `UIApplicationDelegate`, as well as any other <Anchor target="_blank" href="https://firebase.google.com/docs/ios/setup#available-pods">Firebase modules</Anchor> your app delegate uses. For example, to use Cloud Firestore and Authentication:

```swift
import os.log
import DailymotionPlayerSDK
import GoogleCast
import FirebaseCore
```

Configure a [`FirebaseApp`](\[https://firebase.google.com/docs/reference/swift/firebasecore/api/reference/Classes/FirebaseApp]\(https://firebase.google.com/docs/reference/swift/firebasecore/api/reference/Classes/FirebaseApp\)) shared instance in your app's delegate `application(_:didFinishLaunchingWithOptions:)` method:

```swift
FirebaseApp.configure()
```

<br />

## 3. Send event to Google Analytics

Check the dedicated guide to <Anchor target="_blank" href="https://developers.dailymotion.com/v0/docs/listen-to-events-ios-sdk">learn how to listen to events</Anchor>.

```swift
func addPlayerEvent(event: String) {     
   Analytics.logEvent("DailymotionPlayer", parameters: ["playerEvent": event])        
}
```

Sent the first time the Player attempts to start the playback, either because of user interaction, an autoplay parameter or an API call (e.g. `play()`, `loadContent()`, etc.)

Sent when the video playback has paused:

```swift
func videoDidPause(_ player: DMPlayerView) {
     addPlayerEvent(event: "videoDidPause")
}
```

See all <Anchor target="_blank" href="https://developers.dailymotion.com/v0/reference/ios-sdk-player-events">supported iOS events</Anchor>.