braze-inc / braze-swift-sdk

Braze SDK for the Apple ecosystem, including: iOS, macOS, iPadOS, visionOS, tvOS
https://www.braze.com
Other
50 stars 19 forks source link

[Bug]: Content card impression logged once per user session #69

Closed remarcus closed 1 year ago

remarcus commented 1 year ago

Platform

iOS

Platform Version

16.5.1

Braze SDK Version

6.3.1

Xcode Version

14.3.1

Computer Processor

Apple (M1)

Repro Rate

100%

Steps To Reproduce

Hello,

We're in the process of migrating to the Braze Swift SDK.

For Content cards we only use the data and tracking methods (logImpression, logClick, logDismissed) provided from the SDK and we don't use the Content Card UI.

We have noticed that with the latest release of 6.3.1 impression tracking changed and it is no longer in alignment with Android and Web integrations we have.

There is a mention in a changelog for 6.3.1 that goes as following: A content card impression can now be logged once per session. Previously, the Braze-provided Content Cards UI would limit to a single impression per card at maximum, irrespective of sessions.

Although it mentions usage of Content Card UI, we see difference in behaviour when trying to log impressions using ContentCard.logImpression() as it no longer seems to log impressions repeatedly if new session has not started.

We have specific rules that if user is browsing the app and sees the Content card campaign again we log the impression as an example and now this behaviour doesn't seem to work.

Is this limitation something that will be implemented for the other platforms as well? Or this should only be limited to the usage of Content Card UI?

Thanks

Expected Behavior

For every ContentCard.logImpression() that is triggered is reflected on the campaign analytics irregardless if there were previous impressions logged for current user session.

Actual Incorrect Behavior

ContentCard.logImpression() is reflected on campaign analytics only once per user session.

Verbose Logs

No response

Additional Information

No response

remarcus commented 1 year ago

Can someone help me with this? It is blocking our migration release.

hokstuff commented 1 year ago

Hi @remarcus,

After aligning as a team across platforms, it looks like the behavior introduced on iOS in 6.3.1 does differ from the platforms when using a custom UI and calling logImpression(). We are slotting in work to update this iOS behavior such that impressions can be sent multiple times for the same card if you explicitly call logImpression(), regardless if it is in the same session.

In the meantime, as a workaround I would recommend upgrading to 6.3.0 which should have the desired behavior. We will keep you updated once we have released a change around this!

Thanks!

remarcus commented 1 year ago

Hi @hokstuff,

Thanks for the help.

We can't fallback to 6.3.0 because changeUser doesn't work as we use SDK Authentication. I will try to fallback to 6.2.0 for now.

Thanks.

remarcus commented 1 year ago

It seems that 6.2.0 also contains the issue that was fixed on 6.3.1:

Fixes an issue where the previous user's data would not be flushed after calling changeUser(userId:sdkAuthSignature:) when the SDK authentication feature is enabled.

We will keep the 6.3.1 version for now then as apart from impression logging didn't discover any other issues yet.

lowip commented 1 year ago

Hi @remarcus,

We have released 6.5.0 which refines the behavior to allow multiple impressions in a single session.

Best,