Skip to content

Commit b51eb5d

Browse files
committed
updated readme
included section for conversion tracking with better copy
1 parent f1a4ef6 commit b51eb5d

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,40 @@ shortsecure://<Base64 encrypted URL>?<Base64 IV>
156156

157157
- `securedShortUrl` – A fragment (like `#<Base64 key>`) that must be appended manually to the final short URL for decryption.
158158

159+
## 🔄 Conversion Tracking
160+
161+
Conversion tracking is now automated in the SDK — no manual setup or method calls are required.
162+
When your app is opened via a deep link, the SDK automatically records the conversion in the background through the `handleOpen` intent-handling method. Conversion tracking will only be triggered once `handleOpen` is called, so until that happens, no conversion will be recorded.
163+
164+
This means:
165+
- No need to call trackConversion manually.
166+
- Conversions are automatically sent whenever the app is launched from a deep link.
167+
- Your campaigns’ performance can be tracked seamlessly without additional code.
168+
169+
Example:
170+
Simply handle incoming deep links with the SDK’s handleOpen method — conversion tracking happens automatically:
171+
172+
```swift
173+
.onOpenURL { url in
174+
Task{
175+
await sdk.handleOpen(url) { result,destinationUrl, error in
176+
if let error = error {
177+
print("Error: \(error)")
178+
return
179+
}
180+
181+
if let components = result {
182+
print("Host: \(components.host ?? "nil")")
183+
print("Path: \(components.path)")
184+
print("DestinationUrl: \(destinationUrl ?? "nil")")
185+
} else {
186+
print("No components returned")
187+
}
188+
}
189+
}
190+
}
191+
```
192+
159193
## 🌐 Deep Linking Setup (Universal Links for iOS)
160194

161195
To ensure your app can handle deep links created via Short.io, you need to configure Universal Links properly using **Associated Domains** in your Xcode project.

0 commit comments

Comments
 (0)