Git Product home page Git Product logo

Comments (3)

duracelltomi avatar duracelltomi commented on August 16, 2024

Hi,

The "sku" key is not part of the standard enhanced ecommerce product data attributes, I just include it so that everyone can use it if necessary.

Since SKU is not a required attribute of a WooCommerce product, there can be cases when this has not been filled in . The 'SKU: ' prefix has been added to make sure every user can see that the "sku" key has the actual SKU value and not a product ID fallback.

Can you post your use case where you are utilizing this extra "sku" key?

from gtm4wp.

KrzysiekWitbee avatar KrzysiekWitbee commented on August 16, 2024

I don't understand your question well. I have written that when I use your option to use SKU instead of ID in Simple Products in ID filed in DataLayer I found "SKU: 1000" instead of just number like "1000", that's why I had to remove this part of the code which I showed in my first post.

And why I need to use SKU instead of ID? Most of my products are Variable Products. ProductDetails are sent to DataLayer only when user choose the variant. I needed something different. I wanted to send info of ProductDetails when user enter the product page no matter if it is a variable or simple product. But in this case, there could be some problems in Google Analytics because there are different IDs for each variant in a variable product. I had to unify this to have one "ID" for every variant that's why I choose to use this option of SKU. Like in this example store: https://enhancedecommerce.appspot.com/

Let me know if this explanation is understandable to you :)
I am also working on more changes needed to have beautiful enhanced ecommerce reports in Google Analytics :)

from gtm4wp.

duracelltomi avatar duracelltomi commented on August 16, 2024

I've just added a fix which removes the "SKU:" prefix from ecommerce dimensions:
9e084ae

from gtm4wp.

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.