Skip to content

Commit 90220e4

Browse files
feat: expand tag detection to 20 comprehensive tracking tags
- Add 8 analytics tags: GA4, UA, Adobe Analytics, Mixpanel, Amplitude, Segment, Hotjar, FullStory - Add 6 advertising tags: Facebook Pixel, Google Ads, LinkedIn, Twitter, TikTok, Pinterest, Microsoft Ads - Add 5 functionality tags: Optimizely, VWO, Crazy Egg, Mouseflow, Lucky Orange - Organize tags by category with proper consent type mapping - Improve detection with both global objects and script src patterns - Cover major tracking platforms across analytics, advertising, and functionality Total: 20 tags covering the most popular tracking and marketing tools.
1 parent cc7d275 commit 90220e4

File tree

1 file changed

+147
-6
lines changed

1 file changed

+147
-6
lines changed

injected-script copy 2.js

Lines changed: 147 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,9 @@ if (window.ConsentInspector) {
596596
const tags = [];
597597
const consentState = this.getCurrentConsentState();
598598

599-
// Simple tag detection - check for common tracking scripts
599+
// Comprehensive tag detection - check for common tracking scripts
600600
const tagDetectors = [
601+
// Analytics Tags
601602
{
602603
name: 'Google Analytics 4',
603604
type: 'analytics',
@@ -617,6 +618,63 @@ if (window.ConsentInspector) {
617618
document.querySelector('script[src*="google-analytics.com"]');
618619
}
619620
},
621+
{
622+
name: 'Adobe Analytics',
623+
type: 'analytics',
624+
consentType: 'analytics_storage',
625+
check: () => {
626+
return window.s ||
627+
document.querySelector('script[src*="omtrdc.net"]') ||
628+
document.querySelector('script[src*="adobe.com/analytics"]');
629+
}
630+
},
631+
{
632+
name: 'Mixpanel',
633+
type: 'analytics',
634+
consentType: 'analytics_storage',
635+
check: () => {
636+
return window.mixpanel ||
637+
document.querySelector('script[src*="mixpanel.com"]');
638+
}
639+
},
640+
{
641+
name: 'Amplitude',
642+
type: 'analytics',
643+
consentType: 'analytics_storage',
644+
check: () => {
645+
return window.amplitude ||
646+
document.querySelector('script[src*="amplitude.com"]');
647+
}
648+
},
649+
{
650+
name: 'Segment',
651+
type: 'analytics',
652+
consentType: 'analytics_storage',
653+
check: () => {
654+
return window.analytics ||
655+
document.querySelector('script[src*="segment.com"]');
656+
}
657+
},
658+
{
659+
name: 'Hotjar',
660+
type: 'analytics',
661+
consentType: 'analytics_storage',
662+
check: () => {
663+
return window.hj ||
664+
document.querySelector('script[src*="hotjar.com"]');
665+
}
666+
},
667+
{
668+
name: 'FullStory',
669+
type: 'analytics',
670+
consentType: 'analytics_storage',
671+
check: () => {
672+
return window.FS ||
673+
document.querySelector('script[src*="fullstory.com"]');
674+
}
675+
},
676+
677+
// Advertising/Marketing Tags
620678
{
621679
name: 'Facebook Pixel',
622680
type: 'advertising',
@@ -636,12 +694,95 @@ if (window.ConsentInspector) {
636694
}
637695
},
638696
{
639-
name: 'Hotjar',
640-
type: 'analytics',
641-
consentType: 'analytics_storage',
697+
name: 'LinkedIn Insight Tag',
698+
type: 'advertising',
699+
consentType: 'ad_storage',
642700
check: () => {
643-
return window.hj ||
644-
document.querySelector('script[src*="hotjar.com"]');
701+
return window.lintrk ||
702+
document.querySelector('script[src*="snap.licdn.com"]');
703+
}
704+
},
705+
{
706+
name: 'Twitter Pixel',
707+
type: 'advertising',
708+
consentType: 'ad_storage',
709+
check: () => {
710+
return window.twq ||
711+
document.querySelector('script[src*="static.ads-twitter.com"]');
712+
}
713+
},
714+
{
715+
name: 'TikTok Pixel',
716+
type: 'advertising',
717+
consentType: 'ad_storage',
718+
check: () => {
719+
return window.ttq ||
720+
document.querySelector('script[src*="analytics.tiktok.com"]');
721+
}
722+
},
723+
{
724+
name: 'Pinterest Tag',
725+
type: 'advertising',
726+
consentType: 'ad_storage',
727+
check: () => {
728+
return window.pintrk ||
729+
document.querySelector('script[src*="s.pinimg.com"]');
730+
}
731+
},
732+
{
733+
name: 'Microsoft Ads (Bing)',
734+
type: 'advertising',
735+
consentType: 'ad_storage',
736+
check: () => {
737+
return window.uetq ||
738+
document.querySelector('script[src*="bat.bing.com"]');
739+
}
740+
},
741+
742+
// Functionality/Personalization Tags
743+
{
744+
name: 'Optimizely',
745+
type: 'functionality',
746+
consentType: 'functionality_storage',
747+
check: () => {
748+
return window.optimizely ||
749+
document.querySelector('script[src*="optimizely.com"]');
750+
}
751+
},
752+
{
753+
name: 'VWO (Visual Website Optimizer)',
754+
type: 'functionality',
755+
consentType: 'functionality_storage',
756+
check: () => {
757+
return window._vwo_code ||
758+
document.querySelector('script[src*="dev.visualwebsiteoptimizer.com"]');
759+
}
760+
},
761+
{
762+
name: 'Crazy Egg',
763+
type: 'functionality',
764+
consentType: 'functionality_storage',
765+
check: () => {
766+
return window.CE_SNAPPY_CREATED ||
767+
document.querySelector('script[src*="crazyegg.com"]');
768+
}
769+
},
770+
{
771+
name: 'Mouseflow',
772+
type: 'functionality',
773+
consentType: 'functionality_storage',
774+
check: () => {
775+
return window._mfq ||
776+
document.querySelector('script[src*="mouseflow.com"]');
777+
}
778+
},
779+
{
780+
name: 'Lucky Orange',
781+
type: 'functionality',
782+
consentType: 'functionality_storage',
783+
check: () => {
784+
return window.__lo_site_id ||
785+
document.querySelector('script[src*="luckyorange.com"]');
645786
}
646787
}
647788
];

0 commit comments

Comments
 (0)