CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • Google Summer of Code »
  • Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)
Pages: 1 [2] 3

Author Topic: Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)  (Read 5430 times)

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)
April 13, 2015, 11:25:29 am
I really like the ideas of adding better support for Google Analytics, but I'm concerned that in several posts there is a lack of clarity on what technologies and products and workflows are appropriate. Goal conversion would be highly useful, including its relation to Google Flow. It would be great to integrate this into A/B mail testing. Google link tracking from social media shares would be nice. But the idea that came up repeatedly of manually constructing urls is a non-starter.

Quote
The aim is to let "normal" users benefit from google analytics and a/b testing without having them building the url.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

Owen

  • I post occasionally
  • **
  • Posts: 83
  • Karma: 2
    • Leukaemia & Lymphoma Research
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7
  • MySQL version: -
  • PHP version: -
Re: Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)
April 13, 2015, 11:40:27 am
Quote from: JoeMurray on April 13, 2015, 11:25:29 am
I really like the ideas of adding better support for Google Analytics, but I'm concerned that in several posts there is a lack of clarity on what technologies and products and workflows are appropriate. Goal conversion would be highly useful, including its relation to Google Flow. It would be great to integrate this into A/B mail testing. Google link tracking from social media shares would be nice. But the idea that came up repeatedly of manually constructing urls is a non-starter.

I agree about URL builder, it also doesn't make sense for something like that to live in Civi, pretty sure Xav has discussed the not doing the URL builder with Vishal too.

If anyone does need a URL builder better than the google one, here's one we built : http://owendb.github.io/googleanalytics/2015/03/07/GA-URL/

vishalagarwal3010

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4.5
  • CMS version: Drupal 6
  • MySQL version: 14.14
  • PHP version: 5.5.9
Re: Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)
April 13, 2015, 12:18:15 pm
Thanks for the comments.
Given the feedback I think it is best not to do the URL builder (as Owen pointed out that better URL builders already exist)
Integrating support for determining Goal Conversion (Using Google Analytics and Flow reports) would be an intresting thing to explore

Thank You,
Vishal Agarwal 

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)
April 13, 2015, 01:21:53 pm
Thanks for the link, Owen. Good response, Vishal.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

vishalagarwal3010

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4.5
  • CMS version: Drupal 6
  • MySQL version: 14.14
  • PHP version: 5.5.9
Re: Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)
April 13, 2015, 10:53:17 pm
Here is a link which shows how to track Events using GA:
https://developers.google.com/analytics/devguides/collection/analyticsjs/events

Apparently this can be done very easily. On the Event configuration page where I propose to ask the user whether to enable or disable web tracking, I could add an option whether to enable event tracking. This could be a drop down menu where the user could choose which things he wants to track. For example, on the donations page how many visitors actually clicked on "Contribute", how many visitors choose to donate what amount etc. (Or simply we could enable tracking for some default events)
The visitor can then see the Goal conversion as well as the event flow( How many people first choose to donate higher and then reduced their contribution etc.) from GA.

Implementation:
code for function calls would have to be added to the current page which civiCRM currently generates
 
I dont know if it is too late to propose this change. Any comment would be greatly appreciated.

Thank You,
Vishal Agarwal
« Last Edit: April 13, 2015, 10:54:58 pm by vishalagarwal3010 »

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)
April 13, 2015, 11:14:43 pm
Hi,

The proposals are still editable. And yes, will be super useful to track events and provide sensible default values.
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

vishalagarwal3010

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4.5
  • CMS version: Drupal 6
  • MySQL version: 14.14
  • PHP version: 5.5.9
Re: Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)
April 14, 2015, 12:03:39 am
Hi,
This is my updated proposal. Feedback on the same is appreciated. I have highlighted the things which have been updated (maroon color)
Major changes include:
  • The section on adding UTM tags to URL's has been updated with more examples
  • The idea of URL builder has been dropped
  • Provision for enabling Event tracking has been added
  • Changes in the timeline to incorporate the same

PERSONAL INFORMATION

First/Last Name: Vishal Agarwal

Email: vishalagarwal3010@gmail.com

School/University: IIT-Bombay

Graduation Date: 2016

Major/Focus: Computer Science And Engineering

Location: Mumbai

Timezone: GMT + 5:30

Drupal.org Profile: VishalAgarwal

IRC: I use a temporary account

CV/Resume URL: www.cse.iitb.ac.in/~vishala/resume.pdf   

Preferred time of day for virtual/video interview: IST after 10:00 pm

Open Source Experience: None

 

GSOC INFORMATION

If you have participated in Google Summer of Code in the past, please describe your participation:

No this is the first time I am participating.

Have you applied to GSoC in the past and are you applying to any other organizations this year? If so, please explain.

No this is the first time I am applying. CiviCRM is the only organization to which I am applying.

How many hours will you devote to your GSoC project each week? What are your other summer plans (vacation, this time of year isn't your summer and you are in class, etc)?

I will devote at least 35 hours per week towards completing my project. I do not have any other commitments. This time of the year we have our summer break.

 

CIVICRM INFORMATION

Have you registered an account at CiviCRM.org?

Yes I have. Username - VishalAgarwal

Have you even built a site with Drupal, WordPress, or Joomla?

(Please provide details)

No I have never built a site with Drupal, Wordpress or Joomla

Have you ever built a CiviCRM site or helped on a CiviCRM project? 

No I have never built a CiviCRM site nor have I helped on a CiviCRM project

Have you ever posted a questions to the CiviCRM Forums, JIRA, or GitHub?

Yes I have posted questions to the CiviCRM Forum.

http://forum.civicrm.org/index.php/topic,36090.0.html

Have you ever contributed code to CiviCRM?

No I have not contributed code to CiviCRM yet.

If you have not previously contributed to any open source projects, can you provide example code from school?

Code of the projects I have contributed to in the past can be found on github.

https://github.com/VishalAgarwal

 

TECHNICAL INFORMATION

Have you ever utilized IRC?

Yes, I have used it to communicate with Kurund Jalmi.

Have you ever worked with Git?

Yes, I use git regularly for my course projects and lab assignments. 

Question based on knowledge of git:

You just committed some code (and not pushed yet), but you realized there is a typo in commit message. How would you change it (please explain each step of the solution)?

I would use the command "git commit --amend -m "New commit message""

Question based on given 'almighty_function':

Given this function:

function gsoc_function($x, $y, $z) {

if ($y != $z && $x == $y && $x == $z) {

  return "Success!";

}

return "FAIL!"

}

Please provide set of values for $x, $y and $z for function to return "Success!". Explain your solution.

What, if anything would you change or fix in the function?

There is no set of values for $x, $y and $z for which the function would return "Success!".

For the function to return success we need $y and $z to be equal to $x and not equal to each other. This cannot be satisfied for any values of $x,$y and $z.

For the function to work we can remove any one of the three boolean expressions from the if condition.

 

PROJECT INFORMATION

Which project idea sparks your interest and why?

The project involving integrating Google Analytics with CiviCRM and enabling CiviCRM to do A/B testing excites me the most. With more and more web pages being posted day by day organizations want to know more about their visitor flow. Statistically measuring the success of a campaign is a very important thing. Google Analytics provides wonderful API’s for the same.

Getting hands on experience with integrating Google Analytics with CiviCRM would be a wonderful opportunity for me.

 

DETAILED IMPLEMENTATION

Common portion for the discussion below:

  • Under Administer->System Settings->Miscellaneous, the user will have a field to fill in the UA ID generated by Google Analytics
  • Under Event->New Event or Event->Manage Event->Configure Event, the user will have a checkbox either to enable or disable web tracking for that page
  • Under Event->New Event or Event->Manage Event->Configure Event, the user will have a checkbox either to enable or disable event tracking for that page

The project can be divided into four parts-

Use Of UTM Parameters:

  • On an event page under “Help spread the word” section there are buttons to share the event link on social media. The idea is to append the URL’s generated by these buttons with appropriate UTM tags. Similarly I would automatically generate UTM appended URL's wherever possible. For example,
  • The URL in the email body which is sent under "Tell A Friend"
  • URL’s generated by share on social media buttons. (Share on LinkedIn, Recommend on Google Plus, Tweet ,etc.)
  • Embedding the URL (appended with UTM parameters) in the various reports that are generated like Event Income Summary Report and Top Donors Report. This might help in capturing post event traffic.

Web Tracking And Event Tracking:

  • If the user chooses to enable tracking and he has entered information about the organizations UA ID. Google Analytics tracking code will be appended to the event webpage which CiviCRM currently generates.
  • If the user chooses to enable event tracking (Assuming he has chosen to enable web tracking). Either he can choose to enable tracking for some preconfigured fixed set of events or he can manually choose events which he wants to track. Appropriate code for making calls to the analytics library will have to be inserted in the event webpage which CiviCRM currently generates. The link below shows an example of event tracking through GA. https://developers.google.com/analytics/devguides/collection/analyticsjs/events
  • This will allow the organization to determine the conversion ratio (For example, out of the total visitors how many ended up contributing money) and gain deeper insights about how the visitors interact with their webpage.
  • In order to have deeper insights over revenue generated from the various traffic sources, I will use the e-commerce tracking feature of Google Analytics
    https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce
 
Tracking Report:

Google Analytics provides an API called the Embed API. This API would allow the user to view reports generated by Google Analytics from within CiviCRM itself. The Embed API handles user authentication itself. This can be added under Reports->Google Analytics

A/B Testing:

  • The Idea is to use the feature of “Experiments” in Google Analytics to enable A/B testing
    Under Event->Manage Event->Configure Event, if the user chooses to enable A/B testing he/she will be provided with space to paste the tracking code generated by Google Analytics, this code will get appended to the webpage generated by CiviCRM. (Note he/she will have to create two versions of the page using Event->New Event and then paste tracking code into the form for both). Now the user is ready to set up the Experiment using Google Analytics.

The discussion on the project idea can be found on this link:
http://forum.civicrm.org/index.php/topic,36090.0.html

 

EXPECTED DELIVERABLES

Detailed blogpost on the plan and mockups for the project (Week 4)
Detailed blogpost on the status of the project and getting feedback from the community (Week 8)
Public demo for showcasing the work done and getting feedback (Week 9 )
Finally the code would be made available on github and merged with the civicrm-core
Detailed documentation of the implementation along with the current functionalities
Notes on the scope for further development and application
 

PROJECT TIMELINE

19 May and 26 May: Research Weeks

Get up to speed on AngularJS
Get up to speed on the implementation of CiviEvent and CiviContribution
Gaining deeper insights into the API’s provided by Google Analytics
Gathering information about popular naming conventions for UTM parameters
Discovering places where UTM appended URL’s can be auto generated
02 June: Design And Mockup

Discovering appropriate places where the options for configuring the various web tracking parameters should be displayed
Create high level specifications for the project
09 June, 16 June,23 June and 30 June:

Blog post on CiviCRM summarizing the findings of the research and the specifications
First prototype of the auto generated UTM appended URL ,the Web And Event Tracking Feature, the Reporting feature and the A/B testing feature
Minimal set of tests to ensure working of the prototypes
07 July, 14 July and 21 July:

Blog post on civicrm.org with details of the new version and requests of feedback from the Civi community
Deploy a public demo instance
Incorporating changes based on the feedback from early alpha testers
28 July:

Detailed Documentation along with the current functionalities
Tutorials on how to use the New Features
04 Aug:

Buffer Week
11 Aug:

Testing and bug fixing
Merging new code with CiviCRM core
18 Aug:

Wrapping up the project and buffer week
Final blogpost on learning, what has been achieved and scope for future development and application
Which aspect project idea do you see as the most difficult?

Getting up to speed on AngularJS
Getting up to speed on the implementation of CiviEvent and CiviContribution
Which aspect project idea do you see as the easiest?

Appending UTM parameters to the URL generated by the buttons to share the event link on social media.
Which portion of the project idea will you start with?

I will start by overloading the URL’s generated by the share on social media buttons
« Last Edit: April 14, 2015, 04:51:03 am by vishalagarwal3010 »

Owen

  • I post occasionally
  • **
  • Posts: 83
  • Karma: 2
    • Leukaemia & Lymphoma Research
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7
  • MySQL version: -
  • PHP version: -
Re: Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)
April 14, 2015, 01:34:28 am
Hi Vashal,

Event tracking is great for certain elements (things like button clicks, video plays etc..) but if you're thinking about using it for contributions/memberships/event purchase it might be better to consider using ecommerce tracking rather than event tracking :

https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce

Far better level of detail in GA and it's what it was designed to do.

vishalagarwal3010

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4.5
  • CMS version: Drupal 6
  • MySQL version: 14.14
  • PHP version: 5.5.9
Re: Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)
April 14, 2015, 02:43:01 am
Hi Owen,
  Yeah it seems it is better to use ecommerce tracking for purchases (As one can be sure that the purchase was made, unlike the case of adding an Event to the 'Buy' button which may result in an error). One thing which is not clear to me is that CiviCRM or any organization would already have this data in its database, and it would use this data to generate reports. Then why use ecommerce tracking at all?

Thank You,
Vishal Agarwal

Owen

  • I post occasionally
  • **
  • Posts: 83
  • Karma: 2
    • Leukaemia & Lymphoma Research
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7
  • MySQL version: -
  • PHP version: -
Re: Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)
April 14, 2015, 02:58:51 am
Example >

An org has a Christmas campaign and a contribution form. Traffic to the form is sent from a Civi generated email and from social media, both have added URL tracking. With event tracking we could give a number of contributions from social media and from email, with ecommerce tracking we could ascertain the $ value from each channel. In Civi we wouldn't know which individual channel referred the donation, just that the total value of the donations.

There are more reasons but hopefully that illustrates some it.

vishalagarwal3010

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4.5
  • CMS version: Drupal 6
  • MySQL version: 14.14
  • PHP version: 5.5.9
Re: Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)
April 14, 2015, 03:09:33 am
That is a good point. Thanks for the example.
Should I explicitly add this point to my proposal?


Thank You,
Vishal Agarwal

Owen

  • I post occasionally
  • **
  • Posts: 83
  • Karma: 2
    • Leukaemia & Lymphoma Research
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7
  • MySQL version: -
  • PHP version: -
Re: Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)
April 14, 2015, 03:30:03 am
I think it would add value to CiviCRM and I don't think it's too onerous, but it depends on whether you & mentor think you can schedule it in or prioritise it.

Cheers

Owen.

vishalagarwal3010

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4.5
  • CMS version: Drupal 6
  • MySQL version: 14.14
  • PHP version: 5.5.9
Re: Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)
April 14, 2015, 04:52:29 am
Hi Owen,
I have added it to my proposal. The update is in "lime green color" on my previous update.
Thanks for the idea Owen


Thank You,
Vishal Agarwal

vishalagarwal3010

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4.5
  • CMS version: Drupal 6
  • MySQL version: 14.14
  • PHP version: 5.5.9
Re: Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)
May 23, 2015, 05:46:12 am
Hi,
    This is an update of what I have done over the past week.

1. I have read about Smarty and HTML QuickForm
2. I have successfully managed to add a new text field/column to the civicrm_event table. I have added an input text field in the Event Form and have managed to display the input text on the Event Info page. This involved understanding the template architecture of CiviCRM
3. I have created very basic demos on using GA Web Tracking, GA Event Tracking and GA Embed API on a local website
4. I have setup FireBug and FirePHP to help debug things

I need help on the following:
1. I can see the backtrace when a fatal error occurs in the ConfigAndLog. But I want to see the backtrace otherwise too. I have tried to add the "&backtrace=1" string to the URL but no success.
2. I want to add a new Tab called "Web tracking" when creating a new Event. I want to do this so that I can keep all the parameters for web tracking separate from the other Event parameters. How do I go about this?
The only relevant file I could find is civicrm/CRM/Event/Form/ManageEvent/TabHeader.php
3. Where are the CSS files for civicrm located? For example the class "crm-event-manage-eventinfo-form-block-summary" in EventInfo.tpl
4. On the Event Info page after identifying the source of the user (through UTM parameters), I want to retain this information till the final Thank You Page. One way to do this would be to append the same parameters to the intermediate URL's. Is there a better way to do this?
« Last Edit: May 23, 2015, 09:20:04 am by vishalagarwal3010 »

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)
May 25, 2015, 02:38:52 am
Hi Vishala,

What field have you added?
Could you give the url of your github fork and push to it so we can follow your progress?

Could you create for each of your questions (about civicrm) a specific question on civicrm.stackexchange.com? It will be easier to follow what has been answered already and where you still need help
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: 1 [2] 3
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • Google Summer of Code »
  • Queries Regarding Integrating With Google Analytics And A/B Testing (GSOC 2015)

This forum was archived on 2017-11-26.