Comments (3)
Hey Jan,
Since Google's ecommerce API is pretty specific to them, we don't have track
support it by default. But instead, we make sure to expose the normal _gaq
variable and the analytics.ready method, so that any custom tracking can be added really easily.
Here's what that would look like:
<script type="text/javascript">
var analytics=analytics||[];analytics.load=function(e){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=("https:"===document.location.protocol?"https://":"http://")+"d2dq2ahtl5zl1z.cloudfront.net/analytics.js/v1/"+e+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n);var r=function(e){return function(){analytics.push([e].concat(Array.prototype.slice.call(arguments,0)))}},i=["identify","track","trackLink","trackForm","trackClick","trackSubmit","pageview","ab","alias","ready"];for(var s=0;s<i.length;s++)analytics[i[s]]=r(i[s])};
analytics.load("YOUR_API_KEY_HERE");
</script>
<script type="text/javascript">
analytics.ready(function () {
_gaq.push(['_addTrans',
'VEO130303-8530-26143',
'KeyRocket Store',
'0.00',
'',
'0.00',
'Berlin',
'',
'DE'
]);
_gaq.push(['_addItem',
'VEO130303-8530-26143',
'KeyRocket Premium - One-time Payment',
'KeyRocket Premium',
'',
'0.00',
'1'
]);
_gaq.push(['_trackTrans']);
});
</script>
Does that make sense?
from analytics.js.
Hey Jan,
I'm going to close this for now, (the other issue you submitted is being fixed as we speak!)
from analytics.js.
Great, I didn't get back because I wont touch it before I can disable pageviews. But makes perfect sense.
from analytics.js.
Related Issues (20)
- trackLink prevents links to open in top window
- Broken integrations links in the docs
- Support and documentation for Server Side Rendering and Static Site Generation HOT 1
- Possible to rename analytics() ?
- ga() function undefined in ready callback HOT 1
- Mixpanel received nothing from a JavaScript source
- [Guidance/ Advice] For client side tracking, how can i add analytics in UI component library to send event to my Segment?
- Google analytics.js confusion HOT 2
- analytics.js traits behave differently to Analytics for Android HOT 2
- A new Pinterest script is added to index.html at every `page` call HOT 1
- Firefox uncaught error: NS_ERROR_FILE_NO_DEVICE_SPACE HOT 1
- Use Google Analytics v4 HOT 1
- Page reloading in infinite loop in Firefox and Safari if tracking browser location object HOT 1
- While Inject Analytics Lib
- Link dead
- Question: why use identify API on every page accessible only to a loggedin user
- window._cio.page is not a function
- Analytics 2.0 session_id reset
- event.type comes through as "page" for track events
- Memory leak
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from analytics.js.