amp-analytics: Shared interpolation & ampState() URL variable
See original GitHub issue- Extract amp-analytics variable interpolation parsing (
${var}
) so it can be shared with another extension - Implement
${ampState(foo.bar)}
variable that reads from amp-bind state
/cc @lannka
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Documentation: <amp-analytics> - amp.dev
The <amp-analytics> component specifies a JSON configuration object that contains the details for what to measure and ... The URL may include AMP...
Read more >Is there a way to interpolate CSS variables with url()?
You can perform interpolation with most CSS functions, including rgba() (see an example here). In fact, interpolation is one of the main features...
Read more >Google Analytics Client ID In AMP Pages | Simo Ahava's blog
Hey Guys, has anyone tried to set up the AMP Conversion Linker tag for cross-domain tracking and used an AMP variable to set...
Read more >Parameters - Looker Studio Help - Google Help
How parameters share your data in reports ... While editing a report, you can use the +Add a parameter link in the data...
Read more >How to track AMP Pages with Google Analytics 4 - David Vallejo
User Properties; Event Parameters. One of the most notorious misses on Google Analytics 4. Is the lack of AMP (Accelerated Mobile Pages) ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The variable code is here
expandTemplate
is the main function. Right now you can ignore anyfilter
related code as they are dead code and @calebcordry is cleaning up.To be clear, this
VariableService
code is to provide recursive var substitution to JSON config:if you do
expandTemplate(requests.a)
, it will return a promise of123&123
.Another way to do similar thing is to use
urlReplacementService
, of which the code is already in core. To get what you want, you will add anAMP_STATE
macro tourl-replacements-impl.js
, and use it like:I think
urlReplacementService
might be a better choice at this point, despite its name does not sound relevant.This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.