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

I can't see the analytics #574

Open
AhmedSamir848 opened this issue Mar 16, 2020 · 6 comments
Open

I can't see the analytics #574

AhmedSamir848 opened this issue Mar 16, 2020 · 6 comments

Comments

@AhmedSamir848
Copy link

AhmedSamir848 commented Mar 16, 2020

i included the plugin inside my project and it's cordova based to i'm using the normal JS code .
it's the code i used inside onDeviceReady function
`
window.ga.startTrackerWithId('PROPERTY ID', 30, success = () => {
console.log('Google analytics is ready now');

  //the component is ready and you can call any method here
  //To track a Screen (PageView):
  window.ga.debugMode();
  window.ga.setAllowIDFACollection(true);
  window.ga.trackView('home');
  window.ga.trackEvent('Category', 'Action', 'Label', 1)// Label and Value are optional, Value is 
  numeric      

}, error = e => console.log('Error starting GoogleAnalytics', e));
`

and this code prints "Google analytics is ready now" but i can't see the analytics through the web , the number of USERS IN LAST 30 MINUTES doesn't change or any other analytics .
could you help plz ?
thnx

@bots-business
Copy link

Seems this plugin s deprecated
#556

I had worked plugin before. But now it is not works too.

@teslavitas
Copy link

I have the same issue. It work on browser platform, but doesn't work on Android.

@malwatte
Copy link

malwatte commented Sep 1, 2020

You need to switch to the Google Analytics JS library. change the GA project to a web project. It works fine for me.
Firebase Analytics does not have most of the stuff I need.

@nicholasstephan
Copy link

@malwatte What JS library do you mean? Just including the standard analytics snippet in my index.html and pushing pageviews like a website doesn't seem to do anything when running on mobile.

@malwatte
Copy link

malwatte commented Nov 6, 2020

@nicholasstephan I created a new property in Google Analytics (web site). Then added the script in index.html.

There are multiple environemts in the app and the GA tracking ID is different. So I initialize the tracker in my code. I use user ID too.

window.ga('create', trackingId, {
      'storage': 'none',
      'userId': userId
});

then
window.ga('set', 'checkProtocolTask', () => { });

then

window.ga('set', 'page', pageUrl);
window.ga('set', 'title', title);
window.ga('send', 'pageview');

It works for me.

I have <access origin="https://*.google-analytics.com/*" subdomains="true" /> in config.xml

@Turtleted21
Copy link

Turtleted21 commented May 11, 2022

@malwatte
Hi,
Is it this script you add to index.html?

 // Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
  const firebaseConfig = {
            apiKey: "AIzaSyDTWGLBBusvBdss-............,
            authDomain: "test-web-app-84986.firebaseapp.com",
            projectId: "test-web-app-84986",
            storageBucket: "test-web-app-84986.appspot.com",
            messagingSenderId: "771082431820",
            appId: "1:771082431820:web:23256...............",
            measurementId: "G-0CVDSSCDXN"
          };

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

6 participants