juriansluiman / slmgoogleanalytics Goto Github PK
View Code? Open in Web Editor NEWA ZF2 module to track pages, events and ecommerce transactions with Google Analytics
License: Other
A ZF2 module to track pages, events and ecommerce transactions with Google Analytics
License: Other
https://support.google.com/analytics/answer/2444872/?hl=en&utm_id=ad&authuser=5
Update your Analytics tracking code to support Display Advertising
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.
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.
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
.
Hi there i've got the following error:
Fatal error: Interface 'Zend\Module\Consumer\AutoloaderProvider' not found in vendor\juriansluiman\slm-google-analytics\Module.php on line 14
David
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
For now, solutions for #12 cannot be guaranteed as no unit test is made for the Module class. Create case to test unit class.
<? $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).
Add support for Universal Analytics?
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.
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.
The abiltiy to add custom variables would be very usefull.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.