-
-
Notifications
You must be signed in to change notification settings - Fork 14
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 #19
base: master
Are you sure you want to change the base?
Amp analytics #19
Changes from 3 commits
92681d3
52ec4fc
5ac4fcd
69ed440
dc7fd95
5525f45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,6 @@ Shel: | |
enabled: false | ||
twitterId: '' | ||
facebookId: '' | ||
analytics: | ||
tagManager: | ||
id: ~ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,16 @@ | ||
prototype(Shel.Blog:Layout.AmpPage) < prototype(Neos.Neos:Page) { | ||
# Disable Neos.GoogleAnalytics and include amp tag manager -> https://support.google.com/tagmanager/answer/9205783?hl=en | ||
googleTagManagerNoScript > | ||
googleTracking > | ||
googleTracking = Neos.Fusion:Join { | ||
main = afx` | ||
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script> | ||
<amp-analytics config={'https://www.googletagmanager.com/amp.json?id=' + Configuration.setting('Shel.Blog.analytics.tagManager.id') + '>m.url=SOURCE_URL'} data-credentials="include"></amp-analytics> | ||
` | ||
@if.isset = ${Configuration.setting('Shel.Blog.amp.analytics.tagManager.id')} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't it make sense to take the setting from the Analytics package setting path? And did you use a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. according this post, Inside google tag manager you have to create your own container type for amp pages, which then has its own container ID. Perhaps the settings name could be better, something like ampContainerID. I've used a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can always use the |
||
@position = 'after headTag 100' | ||
} | ||
|
||
# Additional scripts are not allowed with amp | ||
lastVisitedNodeScript > | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.