Git Product home page Git Product logo

Comments (3)

ianstormtaylor avatar ianstormtaylor commented on July 4, 2024

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.

ianstormtaylor avatar ianstormtaylor commented on July 4, 2024

Hey Jan,

I'm going to close this for now, (the other issue you submitted is being fixed as we speak!)

from analytics.js.

janmechtel avatar janmechtel commented on July 4, 2024

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)

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.