New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AMP Analytics multi-selector on amp-form-submit #28348
Comments
We're finding that the issue we were facing stemmed from the fact that an |
To recap from the other thread, we need to expand the Quick thoughts: we could apply the same changes that we did with the visibility trigger (allow for selectors within an array to capture multiple/all elements) or we could think about adding special new selector for this kind of use case. I don't think we should just make all selectors I will look into the implementation, and see if any solution pops out to me. |
To continue the discussion in #11380. I thought more about this yesterday. I agreed with @stephengardner point that the current set up is not very efficient when one wants to group triggers together. I also realized the concept When used in visibility trigger, we need to wait for all the to-be-tracked element to have been selected to call to @ampproject/wg-ui-and-a11y and @ampproject/wg-stories for ideas on |
@Enriqe How to filter and only send out storyEvents for selected elements? |
Thank you @micajuine-ho and @zhouyx. To add to the suggestions expressed, it would definitely have unexpected side-effects to existing implementations to change the "selector" to querySelectorAll. Based on documentation here https://amp.dev/documentation/components/amp-analytics/#element-selector a non-breaking change would be adding another option to "selectionMethod" such as "querySelectorAll". |
Hmm sorry, I'm a bit lost here. Are you asking how we currently filter and only fire events from a particular element? Basically, we compare the tagName provided by the publisher's config with the element responsible firing the event: On the event side: amphtml/extensions/amp-analytics/0.1/events.js Lines 460 to 468 in fd697d5
On the story side, we pass the element with amphtml/extensions/amp-story/1.0/story-analytics.js Lines 170 to 172 in fd697d5
|
What about the case where there are 3 |
Oh no, I don't think that's possible today. I can imagine expanding the concept of
But I guess this would be too similar to |
Thanks @Enriqe. Sounds like an issue that applied to storyEvents as well. I like the idea of expanding the |
Sounds like a What about
|
Thanks @zhouyx, I don't see the Also, just checking in on any intent to implement an otherwise selector-based approach Thanks for all the assistance. |
It's an AMP feature, not a Google Analytics feature. You're absolutely right, we failed to document it : ( Here you can find an example use case by GA. And we need to document the feature : )
After reviewing the code, imo this is not a selector. Because the analytics service is not actively selecting element, instead it's passively listening to events. I'm viewing the request as applying additional request filters, and that fits the I'm open to other approaches if it makes config setting easier. If possible let me know the proposal you have in mind. Thanks. |
Thanks @zhouyx Full reproduction example, with steps: Can you clarify what is misconfigured in this example? It appears to follow the method outlined. |
Unfortunately |
Thanks. This approach should work for us when fixed/added
…On Thu, May 28, 2020, 8:41 PM Yuxuan Zhou ***@***.***> wrote:
Unfortunately data-vars is not supported for the on-form-submit event
yet. I can fix it you think the approach works for you. (Your configuration
looks correct, I'm able to get the request sent out with data vars hard
coded)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#28348 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABYG65UNKF4GJ367EOAHYFTRT4ADHANCNFSM4M7CEHKQ>
.
|
Great. I'll keep you updated on the upcoming support. |
Created #28636 to track the work |
Closed via #28748 |
The documentation provided (https://amp.dev/documentation/components/amp-form/?format=websites) does a good job of describing how to track form submissions for POST request forms using
form-submit
andform-submit-success
along withamp-analytics
Unfortunately, while testing, we've found this doesn't work on GET requests. GET request forms are used frequently to do things like perform Search submissions on Shopify by redirecting to "/search?q=...".
If a user presses Enter, submitting the GET request form, it seems like nothing can be tracked. We can track every input change event from the form input, or track specific clicks on the actual submit button (which is rarely clicked), but neither of these solves the issue. We could also perform a POST and a redirect, but this causes the overhead of an actual endpoint needing to be used, and is far less than ideal.
What is the recommended way to track GET request form submissions?
The text was updated successfully, but these errors were encountered: