Code Monkey home page Code Monkey logo

qml-google-analytics's Introduction

QML support for the Google Measurement Protocol Overview

Google Measurement Protocol Overview

The Google Analytics Measurement Protocol allows developers to make HTTP requests to send raw user interaction data directly to Google Analytics servers. This allows developers to measure how users interact with their business from almost any environment. Developers can then use the Measurement Protocol to:

  • Measure user activity in new environments.
  • Tie online to offline behavior.
  • Send data from both the client and server.

Getting Started

import QtQuick 2.0
import QtTest 1.0

import "analytics.js" as Ga

Rectangle {
    id: root

    width: 800
    height: 600

    Component.onCompleted:  {
        Ga.setTrackingId('UA-XXXXXXXX-XX');
        Ga.setClientId('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX');

        Ga.setApplicationName('Sample');
        Ga.setApplicationVersion('1.0.0');
        Ga.setApplicationId('com.app');
        Ga.setApplicationInstallerId('comm.company');
        
        Ga.setUserLanguage('en-EN');
        Ga.setScreenResolution('1280x600');
        Ga.setScreenColors('24-bits');
        Ga.setEndpoint(Ga.debugEndPoint);
    }
    
    Column {
        spacing: 10
        anchors.fill: parent

        Row {
            spacing: 10
            width: parent.width
            height: 100

            Button {
                text: "startSession"
                onClicked: Ga.startSession();
            }

            Button {
                text: "endSession"
                onClicked: Ga.endSession();
            }

            Button {
                text: "trackScreen"
                onClicked: Ga.trackScreen('home');
            }

            Button {
                text: "trackEvent"
                onClicked: Ga.trackEvent('button', 'click', 'play');
            }

            Button {
                text: "trackException"
                onClicked: Ga.trackException('exception!', true);
            }

            Button {
                text: "trackSocial"
                onClicked: Ga.trackSocial('like', 'vk', '/home');
            }
        }
    }
}

qml-google-analytics's People

Contributors

ibatullin avatar misterion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ibatullin

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.