I've got a widget that injects javascript code into my users website. Now I would like to add the ability to listen for the Google Analytics _addTrans
call.
Example of the call to Google Analytics:
<a onclick=" _gaq.push(['_addTrans',
'1234', // transaction ID - required
'Acme Clothing', // affiliation or store name
'11.99', // total - required
'1.29', // tax
'5', // shipping
'San Jose', // city
'California', // state or province
'USA' // country
]);" target='_blank' href="#">CONVERSION</a>
_gaq
is an object supplied by Google Analytics.
Is it possible for my script to also receive the push event to the _gaq object?
I have tried:
if (window._gaq) {
for (var i = 0; i < _gaq.length; i++) {
var method = _gaq[i].shift();
console.log(method);
}
};
window._gaq = {
push: function() {
try {
var args = Array.prototype.slice.call(arguments, 0);
console.log(args);
}
catch(err) {
console.log(err);
}
}
};
It works but Google Analytics is now not able to track conversions anymore. It seems I am overriding it. Any ideas how this could be done?
The basic idea is to prevent double clicks. I'm using html <button> to call a function when clicked, which makes an ajax call. Native <button> behaviour is prevented with event....
The basic idea is to prevent double clicks. I'm using html <button> to call a function when clicked, which makes an ajax call. Native <button> behaviour is prevented with event....
In my current project I discovered a problem using websockets with socket.io and node.js on mobile devices. It seems that there is a problem for mobile deviced handling socket messages in an interval. ...
In my current project I discovered a problem using websockets with socket.io and node.js on mobile devices. It seems that there is a problem for mobile deviced handling socket messages in an interval. ...
With the following code, when shift clicking the label, why isn't the checkbox's click handler fired in FF? Both Chrome and IE11 fires it. <script> function show(event) { alert((...
With the following code, when shift clicking the label, why isn't the checkbox's click handler fired in FF? Both Chrome and IE11 fires it. <script> function show(event) { alert((...
So I'm trying to create a basic angular application that parses some CSV input, and fills a table with the parsed data. You can see a plunker of what I'm trying to achieve here - http://plnkr.co/...
So I'm trying to create a basic angular application that parses some CSV input, and fills a table with the parsed data. You can see a plunker of what I'm trying to achieve here - http://plnkr.co/...