sitefinitysteve / nativescript-google-analytics

Apache License 2.0
23 stars 14 forks source link

Plugin not working in my app #36

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi, I use nativescript angular version my app.component.ts content:

import { Component, OnInit } from "@angular/core";
import * as googleAnalytics from 'nativescript-google-analytics';

@Component({
    selector: "ns-app",
    templateUrl: "app.component.html",
})

export class AppComponent implements OnInit {
    ngOnInit() {
        this.initAnalytics();
    }
    initAnalytics() {
        googleAnalytics.initalize({
            trackingId: 'MYCODE',
            dispatchInterval: 5,
            logging: true
        });
    }
}

I run app and see google analytics but no user active. Please help me what is the wrong my code. I create analytics app generate tracking code and insert to MYCODE Thanx for your help. Bumbella

tscislo commented 6 years ago

My code id pretty much the same, I'm testing on Android. Same result here, no active sessions visible in Analytics.

My code:

import { Component } from "@angular/core";
import * as GoogleAnalytics from "nativescript-google-analytics";
@Component({
    selector: "ns-app",
    templateUrl: "app.component.html",
})
export class AppComponent {
    constructor() {

    }
    public ngOnInit() {
        console.log('App started!')
        GoogleAnalytics.initalize({
            trackingId: `"TRACKING_ID",`
            dispatchInterval: 5,
            logging: true
        });
        GoogleAnalytics.logView("App Component");
    }
}
tscislo commented 6 years ago

@bumbella have you solved your issue?

ghost commented 6 years ago

Sorry but no. I am waiting plugin writer feedback.

sitefinitysteve commented 6 years ago

I'm at a conference right now guys, I'll fire up the demo as soon as i can, but i have no angular experience in nativescript. So if it works in purejs then we might need to pull in an expert 😀

On Sep 25, 2017 8:51 AM, "bumbella" notifications@github.com wrote:

Sorry but no. I am waiting plugin writer feedback.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sitefinitysteve/nativescript-google-analytics/issues/36#issuecomment-331870825, or mute the thread https://github.com/notifications/unsubscribe-auth/ABeI6PzFwVoKHq7XmsJ11I6UB9wYZqkKks5sl6G2gaJpZM4PIxC0 .

patrickarba commented 6 years ago

Same here.

error message:

found a solution in https://github.com/EddyVerbruggen/nativescript-plugin-firebase#includegradle-failed-to-apply-plugin--for-input-string- and the error message become:


A problem occurred configuring root project 'dev'.

Could not resolve all dependencies for configuration ':_F0F1F2F3F4F5DebugApkCopy'. Could not find any version that matches com.google.android.gms:play-services-analytics:11.2.+. Versions that do not match: 11.0.4 11.0.2 11.0.1 11.0.0 10.2.6

  • 18 more

changed 11.2.+ to 11.0.+, error message become:

Found com.google.firebase:firebase-messaging:10.0.1, but version 11.0.+ is needed for the google-services plugin. :processF0F1F2F3F4F5DebugGoogleServices FAILED

Found a solution in the github README as above link: https://github.com/EddyVerbruggen/nativescript-plugin-firebase#found-play-services10ab-but-version-11xy-is-needed Run the command and update SDKs, doesn't work.

tscislo commented 6 years ago

@bumbella @sitefinitysteve There is no problem with plugin. In my case it was just a matter of time after I registered new Analytics Account with new Tracking ID. Approximately after 48hrs I can see all the past and current traffic in my Google Analytics account.