Add cit.nih
This commit is contained in:
parent
90eed60063
commit
cba854ff64
147 changed files with 43354 additions and 0 deletions
|
@ -0,0 +1,18 @@
|
|||
(function (Drupal) {
|
||||
|
||||
/**
|
||||
* Command to attach data using jQuery's data API.
|
||||
*
|
||||
* @param {Drupal.Ajax} [ajax]
|
||||
* {@link Drupal.Ajax} object created by {@link Drupal.ajax}.
|
||||
* @param {object} response
|
||||
* The response from the Ajax request.
|
||||
* @param {string} response.event_name
|
||||
* The event name
|
||||
* @param {object} response.data
|
||||
* The value of the event.
|
||||
*/
|
||||
Drupal.AjaxCommands.prototype.gtagEvent = function (ajax, response) {
|
||||
gtag('event', response.event_name, response.data)
|
||||
}
|
||||
})(Drupal);
|
39
cit.nih.gov/modules/contrib/google_tag/js/gtag.js?sk17fb
Normal file
39
cit.nih.gov/modules/contrib/google_tag/js/gtag.js?sk17fb
Normal file
|
@ -0,0 +1,39 @@
|
|||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('set', 'developer_id.dMDhkMT', true);
|
||||
|
||||
(function (drupalSettings) {
|
||||
const config = drupalSettings.gtag;
|
||||
|
||||
if (config.consentMode === true) {
|
||||
gtag('consent', 'default', {
|
||||
'ad_storage': 'denied',
|
||||
'analytics_storage': 'denied',
|
||||
'ad_user_data': 'denied',
|
||||
'ad_personalization': 'denied',
|
||||
'wait_for_update': 500
|
||||
});
|
||||
}
|
||||
|
||||
if (config.tagId.length !== 0) {
|
||||
const script = document.createElement('script')
|
||||
script.async = true;
|
||||
script.src = 'https://www.googletagmanager.com/gtag/js?id=' + config.tagId
|
||||
script.type = 'text/javascript';
|
||||
document.getElementsByTagName('head')[0].appendChild(script);
|
||||
}
|
||||
|
||||
const additionalConfigInfo = config.additionalConfigInfo || []
|
||||
if (additionalConfigInfo.length === 0) {
|
||||
gtag('config', config.tagId);
|
||||
} else {
|
||||
gtag('config', config.tagId, additionalConfigInfo);
|
||||
}
|
||||
|
||||
const otherIds = config.otherIds || []
|
||||
otherIds.forEach(id => gtag('config', id))
|
||||
|
||||
const events = config.events || []
|
||||
events.forEach(event => gtag('event', event.name, event.data))
|
||||
})(drupalSettings);
|
30
cit.nih.gov/modules/contrib/google_tag/js/gtm.js?sk17fb
Normal file
30
cit.nih.gov/modules/contrib/google_tag/js/gtm.js?sk17fb
Normal file
|
@ -0,0 +1,30 @@
|
|||
const dl = drupalSettings.gtm.settings.data_layer || 'dataLayer'
|
||||
window[dl] = window[dl] || [];
|
||||
|
||||
(function (drupalSettings) {
|
||||
const config = drupalSettings.gtm;
|
||||
|
||||
window[dl].push({'gtm.start': new Date().getTime(), event:'gtm.js'});
|
||||
const gtmSettings = config.settings;
|
||||
if (gtmSettings.include_classes === true) {
|
||||
window[dl].push({
|
||||
'gtm.allowlist': gtmSettings.allowlist_classes ?? [],
|
||||
'gtm.blocklist': gtmSettings.blocklist_classes ?? [],
|
||||
});
|
||||
}
|
||||
|
||||
let gtm_environment = '';
|
||||
if (gtmSettings.include_environment === true) {
|
||||
const gtm_auth = gtmSettings.environment_token ?? '';
|
||||
const gtm_preview = gtmSettings.environment_id ?? '';
|
||||
gtm_environment = '>m_auth=' + gtm_auth + '>m_preview=' + gtm_preview + '>m_cookies_win=x';
|
||||
}
|
||||
config.tagIds.forEach(function(tagId) {
|
||||
const script = document.createElement('script')
|
||||
script.async = true;
|
||||
const dLink = dl!='dataLayer'?'&l='+dl:'';
|
||||
script.src = 'https://www.googletagmanager.com/gtm.js?id=' + tagId + gtm_environment + dLink;
|
||||
script.type = 'text/javascript'
|
||||
document.getElementsByTagName('head')[0].appendChild(script);
|
||||
});
|
||||
})(drupalSettings);
|
|
@ -0,0 +1,3 @@
|
|||
.paragraph--unpublished {
|
||||
background-color: #fff4f4;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue