Code Monkey home page Code Monkey logo

aem-ga's Introduction

Table of content

Purpose of Project

The purpose of this project is to make tracking of user activity easy using Google analytics. The project provides a similar experience as Adobe Analytics. Developers continue to use AEM’s inbuilt analytics framework while the Siteadmin or super-authors leverage a familiar experience for mapping Google analytics(GA) dimensions, events etc within AEM.

Supported Version

  • AEM 6.0
  • AEM 6.1

Prerequisite

  • To get started with AEM-GA, first we need to create a GA account Here .
  • Create a project on google console website (console.developers.google.com) and enable the Analytics API. More detail on creating a project
  • After creating the project you will be redirected to create service account. Create a service account and save the private key as .p12 file. More detail on creating a service account
  • On creating a service account, google provides a service account email id which needs to be register on GA for accessing GA features for that project.
  • Give permission to this service email id as needed in Google Analytics.
  • To register the service account on GA : Go to Google analyitcs and select the account. Now go to admin tab -> ‘User Management’ section under Account -> Enter service account email id -> set the permission for this account -> click on add.

Using AEM-GA

Using AEM-GA is as easy as using sitecatalyst for tracking of user activities.

  • Running :
    • For AEM 6.0, Install AEM User 6.0 package and AEM-GA package

    • For AEM version 6.1, Install AEM User 6.1 package and AEM-GA package

      Open googleanalytics page under etc/cloudservices and click on + icon.

      alt text

      Give the configuration page a name and title, select the available template and press 'ok'. Enter the configuration in the opened dialog and press ok.

      alt text

      Add on + to create a mapping page, select available template, give it a name and press 'ok'.

      alt text

      You have created the mapping page where you can map your AEM variables with GA dimensions.

      alt text

      Now go to siteadmin and apply cloud service configuration on the root page of your project.

      That's all the configuration you need to make to track page view

  • Tracking Events : To track user events on a particular component :
    1. Make a node named as 'analytics'.
    2. Now add properties named as 'cq:trackevents' and 'cq:trackvars' of type 'String[]' to track events and variable respectively.
    3. Do the mapping of these AEM variables with GA variable and AEM events with GA events in the created mapping page.
    4. Now you can call the javascript method gaHandler.record() with appropriate parameters. For example tracking of image component can be done by calling gaHandler.record() with parameter like gaHandler.record({ event: ['imageClick'], values: { imageLink:'Link of Image', imageAsset:'some value', imageTitle:'title of image', }, },'foundation/components/image')

aem-ga's People

Contributors

rajeev-tothenew avatar viveksachdeva avatar

Watchers

Chandan Luthra avatar Bhagwat Kumar avatar Deepak Mittal avatar Aman avatar Imran Mir avatar  avatar  avatar Uday Pratap Singh avatar IntelliGrape avatar James Cloos avatar  avatar Nikhil avatar  avatar Jayati Mittal avatar

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.