Git Product home page Git Product logo

slmgoogleanalytics's People

Contributors

basz avatar codefights avatar drdev avatar gsteel avatar juriansluiman avatar matiasiglesias avatar midnightdesign avatar rwoverdijk avatar snapshotpl avatar wurststulle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

slmgoogleanalytics's Issues

Add support to anonymize ip address

With GA it is possible to obey to new EU laws to remove ip addresses from tracking with this additional call:

_gaq.push (['_gat._anonymizeIp']);

It should be implemented in the Tracker object like $tracker->setAnonymizeIp(true) and false on default. Note this setting does not apply to Dutch laws as GA is completely banned from The Netherlands without prior consent from visitors.

No possibility to specify custom URL

According to Google Analytics reference (the link is for analytics.js tracking, but the same applies to ga.js) is is possible to specify custom page URL to track. But there's no way to set pageview URL in the tracking code.

Can this be implemented? I can do it myself, but your comments would be very helpfull.

P.S. I need this to remove those ugly ?action_object_map=%5B619465961458587%5D&action_ref_map=&blah-blah=โ€ฆ from links (making them unique while they are not), appended by FB.

Items with same SKU causes troubles

From the Google Analytics api docs:

If a transaction contains multiple items and the SKU is not supplied for every item, a GIF request is sent only for the last item added to the transaction for which a SKU is provided. In addition, if your inventory has different items with the same SKU, and a visitor purchases both of them, you will receive data for only the most recently added. For this reason, you should make sure that each item you offer has a unique SKU.

This is currently not solved by SlmGoogleAnalytics:

use SlmGoogleAnalytics\Analytics\Ecommerce;

$trans = new Transaction;
$trans->setId(321);

$item = new Item;
$item->setSku(123);
$item->setPrice(100);
$item->setQuantity(1);
$trans->addItem($item);

$item = new Item;
$item->setSku(123);
$item->setPrice(100);
$item->setQuantity(1);
$trans->addItem($item);

This results in:

_addItem("321", "123", "", "", "100", "1");
_addItem("321", "123", "", "", "100", "1");

While this is expected:

_addItem("321", "123", "", "", "100", "2");

This should be handled inside the API. Expectation: the second, third, ... nth item with the same sku does only alter quantity and nothing else. If the item has another price, product name or category this will not be taken into account. Possibly we could set a flag for this exception_on_sku_overwrite.

Usage with ZF1

We are currently still on ZF1, but planning on migrating. I noticed the composer.json file depends on the COMPLETE ZF2 library. Would it be an idea to only depend on those components that are actually required? For example:

"zendframework/zend-servicemanager": "~2.2"

This way we reduce the amount of downloaded components and allow a gradual upgrade to ZF2

Unit test module class

For now, solutions for #12 cannot be guaranteed as no unit test is made for the Module class. Create case to test unit class.

Call view helper twice causes double rendering

<? $this->googleAnalytics()?>
<? $this->googleAnalytics()?>

The result is the javascript is rendered twice. This should nog be allowed, a flag in the instance must be remembered to stop from rendering the second time. The flag must be able to reset when for example later in the process the container is cleared from its values (for whatever reason).

New Google analytics code

Apparently Google's new analytics code differs from the one generated by SlmGoogleAnalytics. See the following code for instance:

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-000000000-0', 'example.com');
  ga('send', 'pageview');

</script> 

The current one still works, but it'd make sense to update it to use the new one, just in case the current one gets deprecated or removed.

Replace view helper by event listener

It's easy to forget to call GoogleAnalytics as view helper, it's injected into headScript or inlineScript and has furthermore nothing to do with this specific view helper. Look if the view helper can be replaced by an event listener, registering just after the dispatch of the controller, but before rendering of the view.

Perhaps the view helper can stay to push additional events and/or ecommerce tracking points from the view layer.

fatal error on cli usage

Fatal error: Call to a member function plugin() on a non-object in ./vendor/juriansluiman/slm-google-analytics/src/SlmGoogleAnalytics/View/Helper/GoogleAnalytics.php on line 95

$container = $this->view->plugin($this->getContainer());

I'm guessing view isn't set in cli environment in helpers

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.