Code Monkey home page Code Monkey logo

Comments (3)

cmackay avatar cmackay commented on June 12, 2024

How about you test in a clean project to confirm that something else isn't causing an issue.

cordova create analytics-test
cd analytics-test
cordova platform add ios
cordova plugin add https://github.com/cmackay/google-analytics-plugin.git

In the default cordova code after the device ready event occurs, add your tracking id and submit some analytics events. Give that a try and let me know if that works?

from google-analytics-plugin.

avicks avatar avicks commented on June 12, 2024

Will do, I will get back to you with the results. Thank you for the fast response.

from google-analytics-plugin.

cmackay avatar cmackay commented on June 12, 2024

Also when I test out the plugin, I run the above steps of creating a clean cordova project and then I edit the default index.js so it has the below:

        ...
        if (id === 'deviceready') {
            var analytics = navigator.analytics;

            function onSuccess() {
                alert('success');
            }

            function onError(err) {
                alert('error' + err);
                console.log(err);
            }
            analytics.setTrackingId('UA-XXXXXX-X');

            analytics.sendAppView('home', onSuccess, onError);

        }
        ...

Replace the default if (id === 'deviceready') statement with the above and you should see events logged in google analytics. Let me know how it works out.

from google-analytics-plugin.

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.