I would like amp.travel to be added to the list of trusted viewers. This viewer will only be serving stories hosted on amp.travel.
N/A
I'm trying to use a couple features that only trusted viewers are allowed to do (overriding referrer and intercepting XHR).
For overriding referrer, I'm trying to set up GA cross-domain linking for clients that link to their stories in our viewer. Since GA uses referrer to tell if it should do linking, it's currently not possible to make analytics inside of stories do the site linking when they're inside our viewer.
For intercepting XHR, I'm trying to populate the page attachment with related stories based on the user's interests and the context of the viewer they're in. Upon clicking one, I want the viewer to intercept the request and handle the story navigation itself.
I'm trying to set up GA cross-domain linking for clients that link to their stories in our viewer. Since GA uses referrer to tell if it should do linking, it's currently not possible to make analytics inside of stories do the site linking when they're inside our viewer.
Sorry, I'm not sure I follow. Just to clarify: when a link from document A (the story) to document B (any other page) is clicked, you would like to report the referrer as amp.travel (rather than document A)? Or is this needed for reporting when tapping/swiping between stories?
I'm trying to populate the page attachment with related stories based on the user's interests and the context of the viewer they're in. Upon clicking one, I want the viewer to intercept the request and handle the story navigation itself.
This doesn't seem like it should need a trusted viewer. We should be able to achieve this with just <amp-list> and AMP actions. There may be some changes needed, but they should be safer and easier changes than adding a trusted viewer.
Sorry, I'm not sure I follow. Just to clarify: when a link from
document A(the story) todocument B(any other page) is clicked, you would like to report the referrer asamp.travel(rather thandocument A)? Or is this needed for reporting when tapping/swiping between stories?
My use case is when a link from document A (external client) goes to document B (our viewer), which then loads document C (a story) in an iframe. If I try to do GA cross domain linking from A's domain to C's domain it won't work, because C's referrer is set to B. If I could override C's referrer to set it to A (the real referrer), then the cross site linking would work.
This doesn't seem like it should need a trusted viewer. We should be able to achieve this with just
<amp-list>and AMP actions. There may be some changes needed, but they should be safer and easier changes than adding a trusted viewer.
I looked into this awhile ago, and I can't quite remember what amp-list was missing in particular. I'll look through it again and get back to you.
+1 that these should not be coupled to the "trusted viewers".
I've been looking into this again. I think I'd be fine with these things not being coupled to the "trusted viewers".
I'm having a few issues with the page attachment use case though. When trying to use amp-list I get a validation error that says The tag 'template' may not appear as a descendant of tag 'amp-story-page-attachment'. Also, I can't seem to get the clicks to communicate with the viewer at all using AMP actions. Every action I try gives me an error like [Action] "AMP.saveState" is not whitelisted []., even things like A.hide. I can't seem to find any docs about this.
I have managed to do a workaround with <a rel="amphtml"> and using the a2aNavigate viewer message, but it is a bit messy for communicating context.
Most helpful comment
+1 that these should not be coupled to the "trusted viewers".