Reputation: 73
i am trying to track visibility of an element and its showing console error:'Element " a[data-vars-ei] " is required to be an AMP element'. But in case of click tracking similar thing is working fine. I am unable to understand why this is happeing and what I should do to send tracking. below is my code i have written to track events
"tracklinkClicks":{
"on": "click",
"selector": "a[data-vars-ec], div[data-vars-ec], span[data-vars-ec]",
"request": "event",
"vars":{
"eventCategory": "${ec}",
"eventAction": "${ea}",
"eventLabel": "${el}"
}
},
"trackimpressions":{
"on": "visible",
"selector": "a[data-vars-ei]",
"request": "event",
"vars":{
"eventcategory": "${ec}",
"eventaction": "${ei}",
"eventlabel": "${el}"
},
"extraUrlParams":{
"ni":"1"
}
},
Upvotes: 4
Views: 410
Reputation: 95
on: visible
is working only with AMP elements like amp-img, amp-iframe, amp-ad etc'.
Upvotes: 3