Amphtml: amp-analytics e-commerce features

Created on 12 Aug 2016  路  18Comments  路  Source: ampproject/amphtml

amp-analytics needs to support a way for an e-commerce site to be able to track events and capture any relevant information concerning the content on the page, such as product information.

Design is still TBD.

cc @avimehta @borisf

Soon Feature Request analytics

All 18 comments

For Design:
We have a lot of different industry clients in ecommerce - who are all using GTM and Enhanced ecommerce. I will map out their common fields that we have had to modify previously as hopefully it will help support this effort.

We have to do some quite extensive modification to the GTM default dataLayer to support other technologies - it would be great if we can make space for a place to put those in.

We have one customer that is doing an Amp proto for their product category and detail pages -so it would be ideal to share what we come up with for the proto.

Some requirements we have got so far:

  1. Also the ability to support non-cacheable elements would be key such as "logged in state","customer Id",
  2. enforcing the principle that emails (or other PII thats easy to detect) need to be hashed, ie throwing an AMP validation error if people put users emails in plain text in the dataLayer.
  3. (for later on) Variant type for AB Testing.. How cool would AMP AB Testing be... I am sure Optimize team would love that!

This issue hasn't been updated in awhile. @rudygalfi Do you have any updates?

This issue hasn't been updated in awhile. @rudygalfi Do you have any updates?

@rudygalfi - Any news on this feature? We are looking to expand our AMP implementations but we need Enhanced e-commerce to fully work with it. We need product impressions, product clicks, product views to work. If there is documentation on how to implement this already it would be great to be pointed in the right direction.

@styrholm Can you provide more detail on which vendor you're interested to use? Or, if you're doing a custom analytics implementation, give some examples on how you'd see product impressions, product clicks, product views being tracked.

@rudygalfi
We're using GA360 for tracking product impressions, clicks and views. We have it fully implemented on our non-AMP version of the site.

Product impressions on a product listing page where between 1-2000 product items may be displayed (with pagination for each set of 30 designs). The product impression should only trigger if the design is in the view port of the customer (and not multiple times if they scroll up and down).
Product click -> user clicks on the specific product.
Product view -> User views the product page for that specific product.

Have tried to find any instructions of how to set this up or guiding examples but not managed.

Even if online documentation is definitely lacking and what I'm suggesting looks a bit hacky, it does seem to work in GA and you can use this Git snippet as a working example of how to build e-commerce and advance e-commerce tracking for GA using the amp-analytics component.
The key-values that are exposed in the "extraUrlParams" section are basically following the GA measurement protocol and can found here

Was wondering if there are any updates on this? Looking to implement this feature as well.

@ikriser - I think you could pick this up. @jeffjose and @lannka can guide you.

Hi Rudy and Jeffrey, do you know if there is some reference of Enhanced Ecommerce Tags used with GTM or OGT on AMP?

Hi Gilberto, Are there some actions/tags on Enhanced Ecommerce that you want us to prioritize?

Hi, I'd like to track the event of adding to cart on my AMP and see the tracking data on my Google Analytics Account, but I have no idea what should be sent to in the "vars". The following is a sample.
`

    {
        "vars": {
            "account": "UA-123456-1"
        },
        "requests": {
            "cart": "https://test.test.com/checkout/cart/add/uenc/${uenc}/product/${productId}/"
        },
        "triggers": {
            "add to cart": {
                "on": "amp-form-submit-success",
                "request": "cart",
                "vars": {
                    "event_name": "ec:addProduct",
                    "eventId": "form-submit-success",
                    "event_category": "Ecommerce",
                    "event_action": "Add to cart",
                    "action": "Add to Cart",
                    "productFieldObject ": {
                        "id": "P12345",
                        "name": "Android Warhol T-Shirt"
                    }
                }
            }
        }
    }

`

@VivianWang1993 Which vendor are you using for this config: gtag or googleanalytics?

/cc @zikas

@VivianWang1993 Which vendor are you using for this config: gtag or googleanalytics?

/cc @zikas

@avimehta I use the gtag. Could you please tell me which one I should use? Thanks

gtag is the correct vendor to use. Let me get back to you with some examples. As a heads up, our support for ecommerce can be and needs to be improved but let be get back to you on what is possible today.

@avimehta Thanks so much. That is great if I can have some examples. Looking forward to your replay.

@avimehta Hello, is there any news?

@avimehta Hi, Any news regarding gtag implementation

Was this page helpful?
0 / 5 - 0 ratings