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

Conversion tracking #35

Closed
markotron opened this issue Jul 4, 2016 · 2 comments
Closed

Conversion tracking #35

markotron opened this issue Jul 4, 2016 · 2 comments
Assignees

Comments

@markotron
Copy link

Hi,

I'm trying to create an ad with all the Tracking settings in place. By all the tracking settings I mean pixel ID and URL parameters.

I tryed with something like this:

final ConversionActionQuery caq = new ConversionActionQuery();
        caq.setFieldFbPixel(Arrays.asList("621916377890091"));

        //formatter:off
        final Ad ad = account.createAd()
                        .setName("Java SDK Test ad")
                        .setAdsetId(Long.parseLong(adSet.getId()))
                        .setCreative(creative)
                        .setStatus("PAUSED")
                        .setBidAmount(100L)
                        .setRedownload(true)
                        .setTrackingSpecs(Arrays.asList(caq))
                        .execute();
        //formatter:on

but I get the StackOverflow exception

Caused by: java.lang.StackOverflowError: null
    at java.lang.Class.isPrimitive(Native Method) ~[na:1.8.0_65]
    at com.google.gson.internal.$Gson$Types.checkNotPrimitive($Gson$Types.java:432) ~[gson-2.3.1.jar:na]
    at com.google.gson.internal.$Gson$Types.access$000($Gson$Types.java:43) ~[gson-2.3.1.jar:na]
    at com.google.gson.internal.$Gson$Types$WildcardTypeImpl.<init>($Gson$Types.java:542) ~[gson-2.3.1.jar:na]
    at com.google.gson.internal.$Gson$Types.canonicalize($Gson$Types.java:109) ~[gson-2.3.1.jar:na]
    at com.google.gson.internal.$Gson$Types$WildcardTypeImpl.<init>($Gson$Types.java:551) ~[gson-2.3.1.jar:na]
    at com.google.gson.internal.$Gson$Types.canonicalize($Gson$Types.java:109) ~[gson-2.3.1.jar:na]
    at com.google.gson.internal.$Gson$Types$WildcardTypeImpl.<init>($Gson$Types.java:544) ~[gson-2.3.1.jar:na]
    at com.google.gson.internal.$Gson$Types.canonicalize($Gson$Types.java:109) ~[gson-2.3.1.jar:na]

Any tips on how to make it work with the current SDK?

Thanks!

@JiamingFB
Copy link
Contributor

Hi markotron,

I can repro this issue and I'll work on it.

As a temporary workaround, you can pass a string to setTrackingSpecs(). You'll need to construct the json string based on the tracking spec.

@JiamingFB JiamingFB self-assigned this Jul 5, 2016
JiamingFB added a commit that referenced this issue Aug 26, 2016
The stack overflow is caused by incorrect gson config.
As @kilink suggested previously, it's probably better to just use a
single global gson instance, as there is no object specific config.
@JiamingFB
Copy link
Contributor

This is fixed in latest commit.

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

No branches or pull requests

2 participants