You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These need to be swappable with the url sst.wri.org in both places. We can use Content Snippets to accomplish this:
Dev tasks
Add a new content snippet for Analytics URL and make its default value https://www.googletagmanager.com. I'm assuming in the rest of these instructions that the machine name is analytics_url
An administrator can update the "Analytics URL" content snippet to use https://sst.wri.org/gtm.js instead of https://www.googletagmanager.com.
When they do this they see a call to https://sst.wri.org/gtm.js in the "Sources" tab of the browser console.
If you view the page's source, the code under the " Google Tag Manager (noscript)" section contains https://sst.wri.org/ not https://www.googletagmanager.com
If the administrator has not updated the Analytics URL value, they should continue to see calls to https://www.googletagmanager.com in both tests above.
How to test:
On https://wri.org/ view source and confirm that there's an <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WGH5WB9" string.
monicapatel21
changed the title
Allow using sst.wri.org instead of https://www.googletagmanager.com
Allow using sst.wri.org instead of https://www.googletagmanager.com (gtm)
Oct 22, 2024
This is ready for testing. The url for analytics can be updated at https://develop-wriflagship.pantheonsite.io/admin/content/content_snippets to https://sst.wri.org instead of https://www.googletagmanager.com and then we will want to verify that the analytics data is coming through from develop. @cpmadera passing to you to test out!
We've got this https://www.googletagmanager.com two places in our build:
https://github.com/wri/wri_sites/blob/main/modules/wri_common/js/wri_gtm.js
https://github.com/wri/wri_sites/blob/main/themes/custom/ts_wrin/templates/layout/html.html.twig#L67
These need to be swappable with the url sst.wri.org in both places. We can use Content Snippets to accomplish this:
Dev tasks
analytics_url
{{ contentSnippets.analytics_url }}
wri_common
javascript drupal settings in this function: https://github.com/wri/wri_sites/blob/main/modules/wri_common/wri_common.module#L522drupalSettings.wri_common.analytics_url
this ticket is done when
https://sst.wri.org/gtm.js
instead ofhttps://www.googletagmanager.com
.https://sst.wri.org/gtm.js
in the "Sources" tab of the browser console.https://sst.wri.org/
nothttps://www.googletagmanager.com
https://www.googletagmanager.com
in both tests above.How to test:
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WGH5WB9"
string.https://sst.wri.org/
The text was updated successfully, but these errors were encountered: