firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

Firebase support for AdServices Framework - AppleSearchAds tracking

Open vminc opened this issue 1 year ago • 6 comments

Description

Reopening the issue in https://github.com/firebase/firebase-ios-sdk/issues/7860 We integrated AdServices framework and is on a supported firebase version, but did not find AppleSearchAds campaign being tracked.

Reproducing the issue

No response

Firebase SDK Version

10.11.0

Xcode Version

15.3

Installation Method

N/A

Firebase Product(s)

Analytics

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet

Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet

Replace this line with the contents of your Podfile.lock!

vminc avatar May 28 '24 04:05 vminc

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar May 28 '24 04:05 google-oss-bot

Same problem here. I searched the SDK but didn't find anything related to AAAttribution and attributionToken. The document is still suggesting the old IDFA way.

eonghk avatar Nov 01 '24 22:11 eonghk

IDFA isn't being received either. Perhaps the message:

GoogleAppMeasurementIdentitySupport dependency is not currently linked. IDFA will not be accessible.

is somehow related to the issue. I checked the dependency in the SPM packages, and it should be linked.

Maybe we can just roll back to version 9.x.x—those versions don't display this message. Though, who knows if that will actually help with collecting identifiers. At least my old projects managed to collect all the data without issues.

The issue has been open for over 9 months now, and still zero response. Incredible...

ftp27 avatar Jan 06 '25 17:01 ftp27

Hi all. Sorry for the late response. Can anyone please try running a fresh install of their app (preferably on device) with Analytics debug mode enabled (i.e. with -FIRDebugEnabled as a launch argument) and share the debug log messages containing the phrase Search Ad?

htcgh avatar Jan 06 '25 23:01 htcgh

@htcgh Hello!

Here is the log filtered by Search Ad:

11.6.0 - [FirebaseAnalytics][I-ACS032006] Scheduling Search Ad Report timer
11.6.0 - [FirebaseAnalytics][I-ACS002002] Search Ad campaign report alarm scheduled to fire in approx. (s): -1736161491.264238
11.6.0 - [FirebaseAnalytics][I-ACS002001] Search Ad campaign report alarm fired
11.6.0 - [FirebaseAnalytics][I-ACS002003] Search Ad campaign report alarm canceled
11.6.0 - [FirebaseAnalytics][I-ACS032006] Scheduling Search Ad Report timer
11.6.0 - [FirebaseAnalytics][I-ACS002002] Search Ad campaign report alarm scheduled to fire in approx. (s): 86399.96683597565
11.6.0 - [FirebaseAnalytics][I-ACS032016] Search Ad Reporter returned test data. Will retry next time.

For more context, I have connected the AdServices and AdSupport frameworks. Additionally, I set consent only after the user makes a decision about the ATT request:

let status: ConsentStatus = granted ? .granted : .denied
FirebaseAnalytics.Analytics.setConsent([
    .analyticsStorage: status,
    .adStorage: status,
    .adUserData: status,
    .adPersonalization: status,
])

SKAdNetwork is configured in Google Analytics exactly as I configured it in older projects where attribution works as intended. My problem is not with Apple Search Ads; we haven't started campaigns there yet. The issue is with Google Ads, but I think our problems are related to IDFA.


UPD: I found the issue. The problem wasn’t with the version; it was the absence of:

OTHER_LDFLAGS = "-ObjC";

I’ll deploy the apps and report if this solves the problem. Hopefully, it helps someone else.

ftp27 avatar Jan 07 '25 11:01 ftp27

Thanks @ftp27 for sharing your debug logs, but it sounds like your issue is more related to SPM not being able to link in GoogleAppMeasurementIdentitySupport. Can you try adding the -ObjC linker flag in your build settings to see if that helps?

htcgh avatar Jan 07 '25 23:01 htcgh

@htcgh Yes, as I mentioned before, I figured it out. It's in the App Store now, and I can already see Google Ads events there. So it works.

ftp27 avatar Jan 09 '25 16:01 ftp27