Giter Club home page Giter Club logo

Comments (28)

JiDW avatar JiDW commented on September 12, 2024 1

Let me ask Ludei about this, to get this right.

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

Hi @JiDW

When you set callback listener for attribution changes, it will be triggered only when attribution for current user changes. So, when you are testing, if you are making install of your app on test device without any previous click to any tracker URL, that means that that particular install has organic attribution. After you have launched the app for the first time on device and install has been tracked, after couple of seconds, this callback method you defined will be triggered with new attribution info.

After that it won't be tracked unless you reattribute your user. So, these are two possibilities for you to test this method:

  • Make the first installation of your app on test device, start it and attribution callback listener should be called. In order to test this properly, you need to:
  • If app is already installed, reattribute your user by clicking on some tracker URL with new campaign info. In this case, app will be launched and attribution callback will be triggered with new information. Of course, for this scenario, you need to take care about reattribution window you have set for your app, but that and any other related questions can be answered to you by our AMs.

Let me know if this worked for you.

Cheers

from cordova_sdk.

JiDW avatar JiDW commented on September 12, 2024

This is not on test, this is on production. When I get this callback, I store the informations in our databases. But right now, only Android devices get tracked. However, I can see that Adjust is able to track iOS devices on its side as they appears in our Adjust account.

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

Okay. I see. Can you tell me which version of SDK are you using?

from cordova_sdk.

JiDW avatar JiDW commented on September 12, 2024

I use the latest available version of the cocoon branch => https://github.com/adjust/cordova_sdk/tree/cocoon

from cordova_sdk.

afjoseph avatar afjoseph commented on September 12, 2024

Hey @JiDW
Are you still facing the same issue? Please let us know your progress.

Cheers :)

from cordova_sdk.

JiDW avatar JiDW commented on September 12, 2024

I think so, I'm going to test it again

from cordova_sdk.

afjoseph avatar afjoseph commented on September 12, 2024

Great!
Also, can you let us know if there was any special configurations you had to adjust to get the SDK to work on Cocoon? We'd include it in the documentation

from cordova_sdk.

JiDW avatar JiDW commented on September 12, 2024

Hello there,

It is still not working unfortunately. Tracking is working fine on Adjust, but client-side the callback is never called.

Our current code (modified for better understanding):

var adjustConfig = new AdjustConfig("xxxxxxxxx", AdjustConfig.EnvironmentProduction);
        adjustConfig.setCallbackListener(function(attribution) {
                        //never called
            localStorage["AttributionAdjust"] = JSON.stringify(attribution);
                        //We then send this to our server to track players server-side
        });
        Adjust.create(adjustConfig);

The "Cocoon" branch is yours. It has been created by @uerceg after he asked me some questions about Cocoon. I do not know what he did exactly.

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

Hi @JiDW

Are you still facing this issue while trying to use the Cordova SDK from the cocoon branch?

from cordova_sdk.

JiDW avatar JiDW commented on September 12, 2024

? You mean the master branch ?

I was already using the cocoon branch. I tested the master branch just now and nothing happens, Adjust is not even initialized. Setting the log level to verbose displays nothing.

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

Hm. We made cocoon branch to be used by people who are actually using cocoon.io for their app development. Our master branch should not be cocoon compatible and that's why we made cocoon branch a while ago.

At this moment, cocoon branch is a bit outdated in comparison with master, but hopefully next week, we will release Cordova SDK v4.10.2 (#48) and after that, we will update cocoon branch as well to be up to date with official Cordova SDK version.

from cordova_sdk.

JiDW avatar JiDW commented on September 12, 2024

Yes I know, I'm the one who asked you to create this branch, I even contributed to it.

It's great to know that you will update the cocoon branch! But without this callback available, the usefulness of adjust is very limited. We can't link a player to an attribution in our database. Could I suggest to try to find why this callback isn't working regardless of the update please ? I'm concerned about the timing. We have a release planned soon and I fear that this bug will not be fixed in time (14 days from now).

Nothing says that updating the sdk will fix this bug anyway so it could be a good start before working on the cocoon branch.

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

We are actually aiming to make this update during the next week.

But never the less, we will investigate this issue. So, lemme just sum up the facts to know where to start the research from:

  1. Your app which is in production is facing this issue and adjust SDK was added to it in the state it has on current cocoon branch?
  2. Do you maybe have any logs which are pointing to some error messages?

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

In the meantime, I have spent some time to build experimental branch called cocoon_new which will contain SDK version that will most probably (maybe with some additional changes before the release) become part of official cocoon branch once Cordova SDK v4.10.2 is released (https://github.com/adjust/cordova_sdk/tree/cocoon_new).

If you can try the SDK from this branch and let me know if you're still facing the same issue, would be lovely.

Looking forward to hear from you soon.

Cheers

from cordova_sdk.

JiDW avatar JiDW commented on September 12, 2024

Hello Ugljeลกa,

Sorry I was having trouble to debug on iOS, for some reasons NSLog aren't output by default anymore on iOS10. In the meantime I tried this new branch on Android and it didn't work at first because of this error:

11-21 16:07:53.283: W/IDTKLog(18271): IDTK_LOG_WARNING: [JS] Invoked in JSValueRef ludei::js::core::JSConsole::Warn line 153: Calling deprecated function! Use the setAttributionCallbackListener instead. Check adjust_config.js for more info
11-21 16:07:53.313: E/IDTKLog(18271): IDTK_LOG_ERROR: [JS] Invoked in void ludei::js::utils::JSUtilities::PrintException line 95: JavaScript Exception ( Tag: 'load'): ReferenceError: attributionCallbackListener is not defined
11-21 16:07:53.313: E/IDTKLog(18271): at AdjustConfig.setCallbackListener (/plugins/com.adjust.sdk/www/adjust_config.js:124:40)
11-21 16:07:53.313: E/IDTKLog(18271): at Object.ch.lanceJeu (canvas/main.js:642:16)
11-21 16:07:53.313: E/IDTKLog(18271): at core.js:55:7
11-21 16:07:53.313: E/IDTKLog(18271): at Script.script.onload (core.js:43:9)

I guess you updated the API, and we updated our code to change it to "setAttributionCallbackListener" and the error disappeared.
We kept the logging level to Verbose.

However we have only 1 log every time: the warning that adjust is running on production mode and that's it. Nothing else. No callback, no other logs or errors.

I'm going to test on iOS.

Regards.

from cordova_sdk.

JiDW avatar JiDW commented on September 12, 2024

Tested in iOS : I'm lost. What is the expected behavior exactly ?

On iOS, the new branch worked the first time. I got an attribution (organic, obviously). Tried to replicate it without success.

I uninstalled the app, I tried to change the environment to "Sandbox" without any luck.

Then my colleague tested it on Android again and it worked.

Can you tell me how to replicate an attribution test successfully please ?

from cordova_sdk.

JiDW avatar JiDW commented on September 12, 2024

And aren't am I supposed to get a bunch of logs with a Verbose logging profile ? Because I'm getting nothing.

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

Yeah, we added new method for attribution callback setting named setAttributionCallbackListener, but old one will be re-enabled again with new version, but with release of 5.0.0 in the future probably completely removed and for the time being just deprecated.

Situation from message 1/3 from above is expected -> if you are using production environment variable, we do not log anything in production mode other than just one message on start in which we inform user in which environment SDK was started. So that is pretty much expected.

Yes, you are supposed to get bunch of logs when your app is started in sandbox environment and log level is set to verbose. I dunno where are you checking your logs iOS, but if you are just checking them as part of Xcode -> Devices menu, iOS 10 devices have some issues because logs are being flooded with some messages which make logs reading pretty useless. On the other side, if you open you Xcode project directly with Xcode and run it on the device (works for iOS 10 as well), logs are nicely readable. If you are trying to check logs on Android device, I am checking them with adb tool by running this command:

adb logcat -s "Adjust,chromium"

chromium is in my case log which Cordova app uses to display logs from JavaScript, maybe your case is a bit different.

Checking whether your attribution delegate gets triggered properly is pretty much done how I described in my first answer to this issue, so like this:

  • Completely uninstall app from your test device.
  • Forget your test device from our backend.
  • Install the app again on device and run it.

In this scenario, SDK will send first (install) session package to backend, install will get tracked and after a while, SDK will get info about final attribution for this app install and, if implemented, SDK will trigger attribution callback with that final attribution info.

Same testing scenario should be performed regardless of platform, works the same on Android and iOS device.

I would definitely now be interested what do you see in iOS and Android verbose logs (with sandbox environment) when these tests are performed on your test devices.

Looking forward to hear from you.

from cordova_sdk.

JiDW avatar JiDW commented on September 12, 2024

Hello there,

First of all, great news: the cocoon_new branch works perfectly! (Or at least it looks like it)
I didn't know that in production mode, the logs were shutdown.

I don't know if there is a way to simulate a campaign to check if the attribution is correct but at least the callback is correctly called.

I wasn't able to see the logs on iOS10 because Cocoon gives you an already compiled archive, so I can't use xcode for debugging. It's just than Cordova should use the new ios10 "os_log" instead of "NSLog" to output console.log messages, as NSLog are not displayed anymore once the app is signed.

Anyway, #cocoon_new works, so thank you very much!

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

Hellou,

Great news! ๐ŸŽ‰

There is a way to simulate check if the attribution is correct (by this I am assuming you mean to check if you can get anything other than organic attribution to the attribution callback). Easiest possible way is if you just generate some test tracker in your adjust dashboard, take it's token (let's say that the token is abc123) and make a tracker URL out of it (something like https://app.adjust.com/abc123). Of course, you can go more in depth, by creating other campaign parameters in the dashboard such as creative, network, etc and append those to URL as well (https://app.adjust.com/abc123?campaign=something&network=something_else).

With this URL, what I use for testing purposes is a simple free web hosting solution (neocities.org) in which I just make a dummy link on my webpage on behind which I put this tracker URL.

Once you have this set up, just do the following:

  1. Completely uninstall the app from your device.
  2. Forget the device from our backend.
  3. Open your neocities.org webpage in mobile browser and click on the URL. This will (if your app is in the store) guide you to the store and show your app in it, or if app is still not in the store - open the store and say that item has not been found. If your app is already in the store, just close the store after click on tracker URL has open it.
  4. Run the current app version you are testing on your test device (pretty much make an install of it so that our SDK tracks an install).

That's it. When the SDK gets attribution information from the backend, attribution parameters which we deliver to your callback should be the ones (tracker token, campaign, network, etc) which you used to build your tracker URL which you clicked in this testing procedure.

Also, for the record, we will most probably use logic from cocoon branch on master as well, because apparently this stringify approach works in every situation (Cordova, Ionic and cocoon) while current master is not really cocoon.io friendly.

Will update you once this happens, of course.

Cheers

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

Hi @JiDW

https://github.com/adjust/cordova_sdk/releases/tag/v4.10.2 is now live.

cocoon.io functionality should now be part of the master branch. Feel free to try it out, from master branch, since we removed cocoon branches.

If everything's working for you, I guess we can as well close this issue?

Cheers

from cordova_sdk.

JiDW avatar JiDW commented on September 12, 2024

Hello there,

Yes the plugin works but there is still an issue, it's the same one than last year.
ATM we can't compile a Cocoon project with Adjust. Here is what Ludei (Cocoon) has to say about it:

The latest available Play Services analytics plugin is being included:

<framework src="com.google.android.gms:play-services-analytics:+" />

As we have updated the Android SDKs recently and now we have newer versions available, different plugins include different GMS versions what leads to the above error.

Fork that plugin and just set the version to 9.0.2, that's the one we use in all our plugins.

<framework src="com.google.android.gms:play-services-analytics:9.0.2" />

Using a + is not a good option as you are using the latest available and that version could be even not compatible with your own plugin if it's not up to date.

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

Hi,

This line exists only to help users automatically include support for Google Play Services which our SDK needs in order to read Google Play Services Advertising Identifier (gps_adid parameter being sent in sessions/events).

If you are including Google Play Services library in any other way, feel free to remove this line from our plugin. It is not important at all that analytics part of the Google Play Services is included to your app as part of our plugin. As long as it exists, everything's just fine.

Feel free to remove the line from our plugin and once you run the app, track some events and check for presence of gps_adid parameter inside of the verbose logs once event is being tracked. If there's one, voila. All good.

This also described at the end of this chapter in README: https://github.com/adjust/cordova_sdk#google-play-services

from cordova_sdk.

JiDW avatar JiDW commented on September 12, 2024

Ok, sure ! But if the version isn't a big thing, could you not set the number to something else than "latest" to prevent this, like suggested please ?

If I have to fork Adjust again just for this, I will have to check for updates everytime I want to build.

If you have reasons not to, I will fork, obviously.

Regards.

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

We always kinda tend to test our SDK with latest stable releases of stuff like Google Play Services library.

Lemme just get this straight - putting:

<framework src="com.google.android.gms:play-services-analytics:+" />

or current latest:

<framework src="com.google.android.gms:play-services-analytics:10.0.1" />

For you makes no difference?

If no, any particular version which would cause you not to fork the repo?

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

๐Ÿ‘‹ @JiDW

Any update on this issue?

from cordova_sdk.

afjoseph avatar afjoseph commented on September 12, 2024

@JiDW I'll close the issue for now. Please feel free to reopen it if there necessary :)

from cordova_sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.