Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook standards events not being tracked #86

Closed
RicardoRB opened this issue Mar 6, 2021 · 11 comments · Fixed by #99
Closed

Facebook standards events not being tracked #86

RicardoRB opened this issue Mar 6, 2021 · 11 comments · Fixed by #99

Comments

@RicardoRB
Copy link

All the events are showing in my dashboard but not the standards events as "purchase" or "checkout"

Expected Behavior

Tracking Facebook standards events

Current Behavior

Not tracking standards events

Possible Solution

Steps to Reproduce (for bugs)

  1. Track any standard event
  2. Check your dashboard

Context

I can not tracking what user add to cart or purchase

Your Environment

[√] Flutter (Channel stable, 1.22.6, on Microsoft Windows [Version 10.0.19042.804], locale es-ES)
• Flutter version 1.22.6 at C:\tools\flutter
• Framework revision 9b2d32b605 (6 weeks ago), 2021-01-22 14:36:39 -0800
• Engine revision 2f0af37152
• Dart version 2.10.5

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\ricar\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
X Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[!] Android Studio (version 4.1.0)
• Android Studio at C:\Program Files\Android\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.54.1)
• VS Code at C:\Users\ricar\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.20.0

[√] Connected device (1 available)
• Lenovo P2a42 (mobile) • ZY223SXWKH • android-arm64 • Android 7.0 (API 24)

! Doctor found issues in 2 categories.

@RicardoRB RicardoRB changed the title Facebook standards events not being tracking Facebook standards events not being tracked Mar 6, 2021
@naoaki-kaito
Copy link

I had the same problem.
I'm using logEvent alternatively for now.

example:

FacebookAppEvents().logEvent(
  name: "fb_mobile_content_view",
      parameters: {
        "content": 'XXX',
        "currency": 'XXX',
        "value": 'XXX',
  },
);

app events names are following.
Collaborative Ads App Events API

@RicardoRB
Copy link
Author

I had the same problem.

I'm using logEvent alternatively for now.

example:


FacebookAppEvents().logEvent(

  name: "fb_mobile_content_view",

      parameters: {

        "content": 'XXX',

        "currency": 'XXX',

        "value": 'XXX',

  },

);

app events names are following.

Collaborative Ads App Events API

Thanks! I'll try it as a temporary solution

@DennisAlund
Copy link
Member

Thank you for the report.

Not sure I fully understand what the scope of the problem is? You are missing some event methods?

Regarding the one you mentioned in the example, am I understanding it correctly that you are having an issue with the logViewContent() method as described in #73?

@DennisAlund
Copy link
Member

If the issue is that you're missing some alias methods for logging events, there are a a few paths to take on that

  1. Make a list of the exact methods you'd want/need and wait for me or someone to implement it.
  2. Make a pull request with said methods implemented 🤗
  3. In the meanwhile, you can create extension methods to implement them in your own project, while waiting. See comments made in this PR: Added Support for ISOCurrency in complete registration #67 (comment)

@RicardoRB
Copy link
Author

Thank you for the report.

Not sure I fully understand what the scope of the problem is? You are missing some event methods?

Regarding the one you mentioned in the example, am I understanding it correctly that you are having an issue with the logViewContent() method as described in #73?

The problem is that I can't see the standard events in my Facebook dashboard (fb_mobile_purchase, fb_mobile_add_to_cart, fb_mobile_initiated_checkout). Those are not possible to be tracked with Facebook campaigns because are not getting triggered. The rest are showing in my Facebook Analytics.

I'm not sure what kind of problem can it be, I'll try with as @naoaki-kaito suggested, and I'll come back to report it as a temporary solution.

@RicardoRB
Copy link
Author

I had the same problem.
I'm using logEvent alternatively for now.

example:

FacebookAppEvents().logEvent(
  name: "fb_mobile_content_view",
      parameters: {
        "content": 'XXX',
        "currency": 'XXX',
        "value": 'XXX',
  },
);

app events names are following.
Collaborative Ads App Events API

I tried but still doesn't work, have you done something special? Do you use "await" to track it?

An example of what I have:

_facebookAppEvents.logEvent(
      name: "fb_mobile_add_to_cart",
      parameters: {
        "fb_content": [
          {"id": itemId, "quantity": quantity},
        ],
        "content_type": itemCategory,
        "fb_currency": currency,
      },
      valueToSum: price,
    );

@naoaki-kaito
Copy link

@RicardoRB

fb_content must be String.

"fb_content":  "[{\"id\": \"$itemId\", \"quantity\": $quantity}]"

@DennisAlund
Copy link
Member

DennisAlund commented Mar 24, 2021

Please see example for logViewContent

return logEvent(
name: eventNameViewedContent,
parameters: {
paramNameContent: content != null ? json.encode(content) : null,

@DennisAlund
Copy link
Member

@RicardoRB please update to v0.11.1 where add to cart as been added

Future<void> logAddToCart({
Map<String, dynamic> content,
@required String id,
@required String type,
@required String currency,
@required double price,
}) {
return logEvent(
name: eventNameAddedToCart,
parameters: {
paramNameContent: content != null ? json.encode(content) : null,
paramNameContentId: id,
paramNameContentType: type,
paramNameCurrency: currency,
},
valueToSum: price,
);
}

@DennisAlund
Copy link
Member

Solved in version: 0.11.2

@RicardoRB
Copy link
Author

Thanks @DennisAlund and @naoaki-kaito now it works pretty fine. I had to use the exactly variables that the events also need 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants