Skip to content

Issue using amp-analytics with Shadow DOM #20400

Closed
@enzo-giancola

Description

Hi,

we are facing errors related to amp-analytics
raising when AMP code is imported through a shadow dom
based mechanism (in Polymer).

The problem we noticed:

amp-analytics events are fired within AMP content;
when AMP code is imported through a shadow dom based mechanism (in Polymer) events aren't fired;

How to reproduce:

<amp-analytics><script type="application/json">
        {
            "requests": {                    
                "host": "https://www.facebook.com",
                "base": "${host}/tr?noscript=1",
                "ViewPaywall" : "${base}&ev=ViewPaywall&id=${pixelId}&cd[meter_count]=0&cd[serviceId]=${serviceId}&cd[variant]=${variant}"
            },
            "vars": {                    
                "pixelId":"SOMEPIXELID",
                "variant": "VARIANT(swg-button-experiment)"
            },
            "triggers": {
                "accessAuthorizationFailed": {
                    "on": "subscriptions-access-denied",
                    "request": "ViewPaywall"
                }
            }
        }
    </script></amp-analytics>

Same problem with amp-analytics code like this:

<amp-analytics><script type="application/json"> {
            "requests":{
                "host": "https://pubads.g.doubleclick.net",
                "base": "${host}/activity",
                "ViewPaywall" : "${base};xsp=${xsp};ord=1;num=${num}?" 
            },
            "vars":{
                "xsp":"SOMEXSPCODE",
                "num":"RANDOM" 
            },
            "triggers": {
                "accessAuthorizationFailed": {
                    "on": "subscriptions-access-denied",
                    "request": "ViewPaywall"
                }
            },
            "transport": {
               "beacon": false,
               "xhrpost": false,
               "image": true
            }
        }
       	</script></amp-analytics>

Could you please check?

Best Regards,
Enzo

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions