'', GTM4WP_OPTION_DATALAYER_NAME => '', GTM4WP_OPTION_GTM_PLACEMENT => GTM4WP_PLACEMENT_FOOTER, GTM4WP_OPTION_ENV_GTM_AUTH => '', GTM4WP_OPTION_ENV_GTM_PREVIEW => '', GTM4WP_OPTION_DONOTTRACK => false, GTM4WP_OPTION_LOADEARLY => false, GTM4WP_OPTION_GTMDOMAIN => '', GTM4WP_OPTION_INCLUDE_REMARKETING => false, GTM4WP_OPTION_INCLUDE_LOGGEDIN => false, GTM4WP_OPTION_INCLUDE_USERROLE => false, GTM4WP_OPTION_INCLUDE_USERID => false, GTM4WP_OPTION_INCLUDE_USEREMAIL => false, GTM4WP_OPTION_INCLUDE_USERREGDATE => false, GTM4WP_OPTION_INCLUDE_USERNAME => false, GTM4WP_OPTION_INCLUDE_VISITOR_IP => false, GTM4WP_OPTION_INCLUDE_POSTTYPE => true, GTM4WP_OPTION_INCLUDE_CATEGORIES => true, GTM4WP_OPTION_INCLUDE_TAGS => true, GTM4WP_OPTION_INCLUDE_AUTHOR => true, GTM4WP_OPTION_INCLUDE_AUTHORID => false, GTM4WP_OPTION_INCLUDE_POSTDATE => false, GTM4WP_OPTION_INCLUDE_POSTTITLE => false, GTM4WP_OPTION_INCLUDE_POSTCOUNT => false, GTM4WP_OPTION_INCLUDE_POSTID => false, GTM4WP_OPTION_INCLUDE_POSTFORMAT => false, GTM4WP_OPTION_INCLUDE_POSTTERMLIST => false, GTM4WP_OPTION_INCLUDE_SEARCHDATA => false, GTM4WP_OPTION_INCLUDE_BROWSERDATA => false, GTM4WP_OPTION_INCLUDE_OSDATA => false, GTM4WP_OPTION_INCLUDE_DEVICEDATA => false, GTM4WP_OPTION_INCLUDE_MISCGEO => false, GTM4WP_OPTION_INCLUDE_MISCGEOAPI => '', GTM4WP_OPTION_INCLUDE_MISCGEOCF => false, GTM4WP_OPTION_INCLUDE_WEATHER => false, GTM4WP_OPTION_INCLUDE_WEATHERUNITS => 0, GTM4WP_OPTION_INCLUDE_WEATHEROWMAPI => '', GTM4WP_OPTION_INCLUDE_SITEID => false, GTM4WP_OPTION_INCLUDE_SITENAME => false, GTM4WP_OPTION_EVENTS_FORMMOVE => false, GTM4WP_OPTION_EVENTS_NEWUSERREG => false, GTM4WP_OPTION_EVENTS_USERLOGIN => false, GTM4WP_OPTION_EVENTS_YOUTUBE => false, GTM4WP_OPTION_EVENTS_VIMEO => false, GTM4WP_OPTION_EVENTS_SOUNDCLOUD => false, GTM4WP_OPTION_SCROLLER_ENABLED => false, GTM4WP_OPTION_SCROLLER_DEBUGMODE => false, GTM4WP_OPTION_SCROLLER_CALLBACKTIME => 100, GTM4WP_OPTION_SCROLLER_DISTANCE => 150, GTM4WP_OPTION_SCROLLER_CONTENTID => 'content', GTM4WP_OPTION_SCROLLER_READERTIME => 60, GTM4WP_OPTION_BLACKLIST_ENABLE => 0, GTM4WP_OPTION_BLACKLIST_SANDBOXED => false, GTM4WP_OPTION_BLACKLIST_STATUS => '', GTM4WP_OPTION_INTEGRATE_WPCF7 => false, GTM4WP_OPTION_INTEGRATE_WCTRACKCLASSICEC => false, GTM4WP_OPTION_INTEGRATE_WCTRACKENHANCEDEC => false, GTM4WP_OPTION_INTEGRATE_WCPRODPERIMPRESSION => 0, GTM4WP_OPTION_INTEGRATE_WCEECCARTASFIRSTSTEP => false, GTM4WP_OPTION_INTEGRATE_WCEINCLUDECARTINDL => false, GTM4WP_OPTION_INTEGRATE_WCEECBRANDTAXONOMY => '', GTM4WP_OPTION_INTEGRATE_WCREMARKETING => false, GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL => 'retail', GTM4WP_OPTION_INTEGRATE_WCUSESKU => false, GTM4WP_OPTION_INTEGRATE_WCUSEFULLCATEGORYPATH => false, GTM4WP_OPTION_INTEGRATE_WCREMPRODIDPREFIX => '', GTM4WP_OPTION_INTEGRATE_WCCUSTOMERDATA => false, GTM4WP_OPTION_INTEGRATE_WCORDERDATA => false, GTM4WP_OPTION_INTEGRATE_WCORDERMAXAGE => 30, GTM4WP_OPTION_INTEGRATE_WCEXCLUDETAX => false, GTM4WP_OPTION_INTEGRATE_WCEXCLUDESHIPPING => false, GTM4WP_OPTION_INTEGRATE_WCNOORDERTRACKEDFLAG => false, GTM4WP_OPTION_INTEGRATE_GOOGLEOPTIMIZEIDS => '', GTM4WP_OPTION_INTEGRATE_GOOGLEOPTIMIZETIMEOUT => 4000, GTM4WP_OPTION_INTEGRATE_WPECOMMERCE => false, GTM4WP_OPTION_INTEGRATE_AMPID => '', GTM4WP_OPTION_INTEGRATE_COOKIEBOT => false ); $gtm4wp_business_verticals = array( 'retail' => 'Retail', 'education' => 'Education', 'flights' => 'Flights', 'hotel_rental' => 'Hotel rental', 'jobs' => 'Jobs', 'local' => 'Local deals', 'real_estate' => 'Real estate', 'travel' => 'Travel', 'custom' => 'Custom' ); $gtm4wp_business_verticals_ids = array( 'flights' => 'destination', 'travel' => 'destination' ); $gtm4wp_entity_ids = array( 'tags' => array( 'abtGeneric' => 'AB TASTY Generic Tag', 'ta' => 'AdAdvisor Tag', 'adm' => 'Adometry Tag', 'asp' => 'AdRoll Smart Pixel Tag', 'awct' => 'Google Ads Conversion Tracking Tag', 'sp' => 'Google Ads Remarketing Tag', 'awc' => 'Affiliate Window Conversion Tag', 'awj' => 'Affiliate Window Journey Tag', 'baut' => 'Bing Ads Universal Event Tracking', 'bb' => 'Bizrate Insights Buyer Survey Solution', 'bsa' => 'Bizrate Insights Site Abandonment Survey Solution', 'cts' => 'ClickTale Standard Tracking Tag', 'csm' => 'comScore Unified Digital Measurement Tag', 'mpm' => 'Conversant Mediaplex - IFRAME MCT Tag', 'mpr' => 'Conversant Mediaplex - Standard IMG ROI Tag', 'gclidw' => 'Conversion Linker', 'cegg' => 'Crazy Egg Tag', 'crto' => 'Criteo OneTag', 'html' => 'Custom HTML Tag', 'img' => 'Custom Image Tag', 'dstag' => 'DistroScale Tag', 'flc' => 'Floodlight Counter Tag', 'fls' => 'Floodlight Sales Tag', 'm6d' => 'Dstillery Universal Pixel Tag', 'ela' => 'Eulerian Analytics Tag', 'ga' => 'Google Analytics Tag (classic, legacy)', 'ua' => 'Google Analytics Tag (universal, latest)', 'gcs' => 'Google Consumer Surveys Website Satisfaction', 'opt' => 'Google Optimize', 'ts' => 'Google Trusted Stores Tag', 'hjtc' => 'Hotjar Tracking Code', 'infinity' => 'Infinity Call Tracking Tag', 'sca' => 'Intent Media - Search Compare Ads', 'k50Init' => 'K50 tracking tag', 'll' => 'LeadLab', 'bzi' => 'LinkedIn Tag', 'ljs' => 'Lytics JS Tag', 'ms' => 'Marin Software Tag', 'mpm' => 'Mediaplex - IFRAME MCT Tag', 'mpr' => 'Mediaplex - Standard IMG ROI Tag', 'messagemate' => 'Message Mate', 'mf' => 'Mouseflow Tag', 'ta' => 'Neustar Pixel', 'ndcr' => 'Nielsen DCR Static Lite Tag', 'nudge' => 'Nudge Content Analytics Tag', 'okt' => 'Oktopost Tracking Code', 'omc' => 'Optimise Conversion Tag', 'messagemate' => 'OwnerListens Message Mate', 'pa' => 'Perfect Audience Pixel', 'pc' => 'Personali Canvas', 'pntr' => 'Pinterest', 'placedPixel' => 'Placed', 'pijs' => 'Pulse Insights Voice of Customer Platform', 'qcm' => 'Quantcast Audience Measurement', 'qpx' => 'Quora Pixel', 'fxm' => 'Rawsoft FoxMetrics', 'scjs' => 'SaleCycle JavaScript Tag', 'scp' => 'SaleCycle Pixel Tag', 'sfc' => 'SearchForce JavaScript Tracking for Conversion Page', 'sfl' => 'SearchForce JavaScript Tracking for Landing Page', 'sfr' => 'SearchForce Redirection Tracking Tag', 'shareaholic' => 'Shareaholic', 'svw' => 'Survicate Widget', 'tdlc' => 'Tradedoubler Lead Conversion Tag', 'tdsc' => 'Tradedoubler Sale Conversion Tag', 'tc' => 'Turn Conversion Tracking Tag', 'tdc' => 'Turn Data Collection Tag', 'twitter_website_tag' => 'Twitter Universal Website Tag', 'uslt' => 'Upsellit Global Footer Tag', 'uspt' => 'Upsellit Confirmation Tag', 'vei' => 'Ve Interactive JavaScript Tag', 'veip' => 'Ve Interactive Pixel', 'vdc' => 'VisualDNA Conversion Tag', 'xpsh' => 'Xtremepush', 'yieldify' => 'Yieldify', 'zone' => 'Zones' ), 'triggers' => array( 'evl' => 'Element Visibility Listener/Trigger', 'cl' => 'Click Listener/Trigger', 'fsl' => 'Form Submit Listener/Trigger', 'hl' => 'History Listener/Trigger', 'jel' => 'JavaScript Error Listener/Trigger', 'lcl' => 'Link Click Listener/Trigger', 'sdl' => 'Scroll Depth Listener/Trigger', 'tl' => 'Timer Listener/Trigger', 'ytl' => 'YouTube Video Listener/Trigger' ), 'variables' => array( 'k' => '1st Party Cookie', 'c' => 'Constant', 'ctv' => 'Container Version Number', 'e' => 'Custom Event', 'jsm' => 'Custom JavaScript Variable', 'v' => 'Data Layer Variable', 'dbg' => 'Debug Mode', 'd' => 'DOM Element', 'vis' => 'Element Visibility', 'f' => 'HTTP Referrer', 'j' => 'JavaScript Variable', 'smm' => 'Lookup Table', 'r' => 'Random Number', 'remm' => 'RegEx Table', 'u' => 'URL' ) ); function gtm4wp_migrate_blacklist_whitelist( $current_options ) { if ( ( array_key_exists( GTM4WP_OPTION_BLACKLIST_ENABLE, $current_options ) ) && ( $current_options[ GTM4WP_OPTION_BLACKLIST_ENABLE ] > 0 ) ) { $_gtmrestrictlistitems = array(); // IDs from https://developers.google.com/tag-manager/devguide#security if ( $current_options[ GTM4WP_OPTION_BLACKLIST_ADADVISOR ] ) { $_gtmrestrictlistitems[] = 'ta'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_ADROLL ] ) { $_gtmrestrictlistitems[] = 'asp'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_AWCONV ] ) { $_gtmrestrictlistitems[] = 'awct'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_AWREMARKET ] ) { $_gtmrestrictlistitems[] = 'sp'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_BIZO ] ) { $_gtmrestrictlistitems[] = 'bzi'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_CLICKTALE ] ) { $_gtmrestrictlistitems[] = 'cts'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_COMSCORE ] ) { $_gtmrestrictlistitems[] = 'csm'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_CUSTOMHTML ] ) { $_gtmrestrictlistitems[] = 'html'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_CUSTOMIMG ] ) { $_gtmrestrictlistitems[] = 'img'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_DBLCLKCOUNT ] ) { $_gtmrestrictlistitems[] = 'flc'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_DBLCLKSALES ] ) { $_gtmrestrictlistitems[] = 'fls'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_GACLASSIC ] ) { $_gtmrestrictlistitems[] = 'ga'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_MARIN ] ) { $_gtmrestrictlistitems[] = 'ms'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_MPLEXIFRAME ] ) { $_gtmrestrictlistitems[] = 'mpm'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_MPLEXROI ] ) { $_gtmrestrictlistitems[] = 'mpr'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_MEDIA6DEG ] ) { $_gtmrestrictlistitems[] = 'm6d'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_TURNCONV ] ) { $_gtmrestrictlistitems[] = 'tc'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_TURNDATA ] ) { $_gtmrestrictlistitems[] = 'tdc'; } if ( $current_options[ GTM4WP_OPTION_BLACKLIST_UA ] ) { $_gtmrestrictlistitems[] = 'ua'; } $current_options[ GTM4WP_OPTION_BLACKLIST_STATUS ] = implode( ',', $_gtmrestrictlistitems ); } return $current_options; } function gtm4wp_reload_options() { global $gtm4wp_defaultoptions, $gtm4wp_business_verticals; $storedoptions = (array) get_option( GTM4WP_OPTIONS ); if ( ! is_array( $gtm4wp_defaultoptions ) ) { $gtm4wp_defaultoptions = array(); } if ( !isset( $storedoptions[ GTM4WP_OPTION_BLACKLIST_STATUS ] ) ) { $storedoptions = gtm4wp_migrate_blacklist_whitelist( $storedoptions ); } $return_options = array_merge( $gtm4wp_defaultoptions, $storedoptions ); $return_options[ GTM4WP_OPTION_BLACKLIST_STATUS ] = explode( ',', $return_options[ GTM4WP_OPTION_BLACKLIST_STATUS ] ); if ( defined( 'GTM4WP_HARDCODED_GTM_ID' ) ) { $return_options[ GTM4WP_OPTION_GTM_CODE ] = GTM4WP_HARDCODED_GTM_ID; } if ( defined( 'GTM4WP_HARDCODED_GTM_ENV_AUTH' ) ) { $return_options[ GTM4WP_OPTION_ENV_GTM_AUTH ] = GTM4WP_HARDCODED_GTM_ENV_AUTH; } if ( defined( 'GTM4WP_HARDCODED_GTM_ENV_PREVIEW' ) ) { $return_options[ GTM4WP_OPTION_ENV_GTM_PREVIEW ] = GTM4WP_HARDCODED_GTM_ENV_PREVIEW; } if ( !array_key_exists( $return_options[ GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL ], $gtm4wp_business_verticals ) ) { $return_options[ GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL ] = $gtm4wp_defaultoptions[ GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL ]; } return $return_options; } function gtp4wp_debug_file( $debug_data ) { $fp = fopen( dirname( __FILE__ ) . '/' . date( 'Y-m-d-H-i-s-u' ) . '.txt', 'w' ); if ( $fp ) { fwrite( $fp, $debug_data ); fclose( $fp ); } } $gtm4wp_options = gtm4wp_reload_options();