gtm4wp_enqueue_scripts

The Google Tag Manager for WordPress gtm4wp enqueue scripts function.

Description

gtm4wp_enqueue_scripts(); 

Usage

  1. if ( !function_exists( 'gtm4wp_enqueue_scripts' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-tag-manager-for-wordpress/public/frontend.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = gtm4wp_enqueue_scripts(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/public/frontend.php  
  1. function gtm4wp_enqueue_scripts() { 
  2. global $gtm4wp_options, $gtp4wp_plugin_url; 
  3.  
  4. if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_OUTBOUND ] ) { 
  5. $in_footer = apply_filters( 'gtm4wp_' . GTM4WP_OPTION_EVENTS_OUTBOUND, false); 
  6. wp_enqueue_script( "gtm4wp-outbound-click-tracker", $gtp4wp_plugin_url . "js/gtm4wp-outbound-click-tracker.js", array( "jquery" ), GTM4WP_VERSION, $in_footer ); 
  7.  
  8. if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_DOWNLOADS ] ) { 
  9. $in_footer = apply_filters( 'gtm4wp_' . GTM4WP_OPTION_EVENTS_DOWNLOADS, false); 
  10. wp_enqueue_script( "gtm4wp-download-tracker", $gtp4wp_plugin_url . "js/gtm4wp-download-tracker.js", array( "jquery" ), GTM4WP_VERSION, $in_footer ); 
  11.  
  12. if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_EMAILCLICKS ] ) { 
  13. $in_footer = apply_filters( 'gtm4wp_' . GTM4WP_OPTION_EVENTS_EMAILCLICKS, false); 
  14. wp_enqueue_script( "gtm4wp-email-link-tracker", $gtp4wp_plugin_url . "js/gtm4wp-email-link-tracker.js", array( "jquery" ), GTM4WP_VERSION, $in_footer ); 
  15.  
  16. if ( $gtm4wp_options[ GTM4WP_OPTION_INTEGRATE_WPCF7 ] ) { 
  17. $in_footer = apply_filters( 'gtm4wp_' . GTM4WP_OPTION_INTEGRATE_WPCF7, false); 
  18. wp_enqueue_script( "gtm4wp-contact-form-7-tracker", $gtp4wp_plugin_url . "js/gtm4wp-contact-form-7-tracker.js", array( "jquery" ), GTM4WP_VERSION, $in_footer ); 
  19.  
  20. if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_FORMMOVE ] ) { 
  21. $in_footer = apply_filters( 'gtm4wp_' . GTM4WP_OPTION_EVENTS_FORMMOVE, false); 
  22. wp_enqueue_script( "gtm4wp-form-move-tracker", $gtp4wp_plugin_url . "js/gtm4wp-form-move-tracker.js", array( "jquery" ), GTM4WP_VERSION, $in_footer ); 
  23.  
  24. if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_SOCIAL ] ) { 
  25. $in_footer = apply_filters( 'gtm4wp_' . GTM4WP_OPTION_EVENTS_SOCIAL, false); 
  26. wp_enqueue_script( "gtm4wp-social-actions", $gtp4wp_plugin_url . "js/gtm4wp-social-tracker.js", array( "jquery" ), GTM4WP_VERSION, $in_footer ); 
  27.  
  28. if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_YOUTUBE ] ) { 
  29. require_once( dirname( __FILE__ ) . "/../integration/youtube.php" ); 
  30.  
  31. if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_VIMEO ] ) { 
  32. require_once( dirname( __FILE__ ) . "/../integration/vimeo.php" ); 
  33.  
  34. if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_SOUNDCLOUD ] ) { 
  35. require_once( dirname( __FILE__ ) . "/../integration/soundcloud.php" ); 
  36.  
  37. if ( $gtm4wp_options[ GTM4WP_OPTION_SCROLLER_ENABLED ] ) { 
  38. $in_footer = apply_filters( 'gtm4wp_' . GTM4WP_OPTION_SCROLLER_ENABLED, false); 
  39. wp_enqueue_script( "gtm4wp-scroll-tracking", $gtp4wp_plugin_url . "js/analytics-talk-content-tracking.js", array( "jquery" ), GTM4WP_VERSION, $in_footer );