SempaiGames / haxe-ga

GoogleAnalytics Client API port to Haxe
Other
60 stars 23 forks source link

haxe-ga 0.51 is not working on Android with the latest openfl / lime #18

Closed xmorpher closed 9 years ago

xmorpher commented 9 years ago

haxe-ga 0.51 is not working on Android with the latest openfl / lime openfl [3.1.4] lime [2.5.0]

fbricker commented 9 years ago

Hi, what do you mean by "not working"? Can you provide some information about the error? I'm testing it with the same versions and works for me on Android and other platforms.

xmorpher commented 9 years ago

(Hi,Thanks for replying) is not giving errors, but is not registering the stats, or showing the connection in real time... do you have a sample project? or a sample Screen.hx?

fbricker commented 9 years ago

hmmm... Is it working fine for you on other platforms? Are you first trying to integrate haxe-ga or it was already integrated on your project and stopped working with lime 2.5.0 / openfl 3.1.4?

I've tested the sample code on the documentation page (https://github.com/SempaiGames/haxe-ga) and seems to be working :/

xmorpher commented 9 years ago

I'm first trying to integrate haxe-ga and i thought it was an issue with the latest openfl/lime versions... Since the implementation is pretty simple, i guess the problem is some compatibility between my libs... Could you share a print of your "haxelib list" command to check which lib versions are you using? (lime/openfl/openfl-gpg/openfl-gps-lib/etc)

fbricker commented 9 years ago

Hi, here goes my complete list:

actuate: [1.8.6]
box2d: [1.2.3]
extension-amazonads: [0.0.2]
extension-android-immersive: [1.0.1]
extension-gpgrest: [1.0.1]
extension-harfbuzz: [1.0.3]
extension-iap: [1.1.0]
extension-locale: [1.0.0]
extension-multiads: [1.0.1]
extension-nativedialog: [1.2.1]
extension-share: [2.1.0]
extension-webview: [1.2.1]
flixel-addons: [1.1.0]
flixel-ui: [1.0.2]
flixel: [3.3.11]
format: [3.1.2]
gamecenter: [1.1.1]
haxe-ga: [0.5.1]
haxe-gif: [0.3.3]
HIDE: [0.4.8]
hscript: [2.0.4]
hxcpp: [3.2.102]
hyp-system: [0.2.1]
inthebox-macros: [1.2.0]
layout: [1.2.0]
lime-samples: [2.4.0]
lime: [2.5.0]
monax: [1.5.1]
nape: [2.0.19]
node-webkit: [1.0.7]
openfl-admob: [1.4.1]
openfl-bitfive: [3.0.0]
openfl-gpg: [1.3.0]
openfl-gps-lib: [1.0.4]
openfl-nativedialog: [1.1.1]
openfl-samples: [3.1.0]
openfl-webview: [1.2.1]
openfl: [3.1.4]
polygonal-core: [1.0.4]
polygonal-ds: [1.4.1]
polygonal-printf: [1.0.2-beta]
promhx: [1.0.21]
stablexui: [1.1.5]
stub-libs: [0.1.1]
swf: [1.9.0]
thx.color: [0.16.1]
thx.core: [0.28.0]
xmorpher commented 9 years ago

Thanks... we have basically the same, except for lime: 2.5.2 and openfl 3.2.2 (latest) but is not tracking the views... Since the implementation is simple, i don't understand where can be our mistake... Any chance that you could share the sample project you use to test the lib to check step by step where can be the problem? regards

fbricker commented 9 years ago

Hi, here goes a simple test (the same that's published on the home page of the project):

  1. execute "openfl create project SampleProject"
  2. edit project.xml and add
  3. edit Main.hx to look like this:
package;

import openfl.display.Sprite;
import googleAnalytics.Stats;

class Main extends Sprite {

    function new(){
        super();
        Stats.init('UA-27265081-3', 'testing.sempaigames.com');
        haxe.Timer.delay(trackStuff,5000);
    }

    function trackStuff(){
        // track some page views
        Stats.trackPageview('/page.html','Page Title!');
        Stats.trackPageview('/untitled.html');

        // track some events
        Stats.trackEvent('play','stage-1/level-3','begin');
        Stats.trackEvent('play','stage-2/level-4','win');
    }
}

Once you have this, you can just run "openfl test neko" or any other platform and you'll be tracking. This exact sample is working on my computer (attaching screenshots from the real time view).

captura de pantalla 2015-07-30 a las 10 00 01 captura de pantalla 2015-07-30 a las 10 00 10

If you still have issues you I think you should check:

  1. You're placing the right UA-XXXXXXX-N ID when calling init
  2. You're writing the right host name when calling init
  3. You don't have any kind of ad-block installed on your test devices.
  4. Your network allows the traffic to google analytics (no proxy or anything like it in the middle) without issues.
  5. If al the previous things are ok and you still have issues, you should consider to put your hands into "googleAnalytics/internals/request/Request.hx" and add some traces to see what's going on.
profelis commented 9 years ago

I have same problem 2 days ). Then I found in README.MD main expression:

Note that until Android and iOS native SDK gets integrated on this package, this project needs you to provide an ID of a Website to work propperly.

xmorpher commented 9 years ago

@profelis: ...and the "ID of a Website" can be any, or must be exactly the publisher domain, or the domain associated with the app? or anything else? @fbricker : thanks a lot! i will try that... step by step ... (i wonder about that "website id" now)

fbricker commented 9 years ago

Please let me know if it's the website ID issue... i'll prioritize the native SDK integration soon... I've having a hard time finding free time to work on this :/

xmorpher commented 9 years ago

Ok, it was the "Website Id".... the problem was that i had the track ID as an "App" not as a "Website" so i had to create a new track id as a website and it worked... (the only problem is that as a website doesn't track well app version and other stuff but at least is tracking pageviews, screens and events...) Thanks for your help and the great lib/extension!