monsterinsights_tools_url_builder_tab

The Google Analytics for WordPress by MonsterInsights monsterinsights tools url builder tab function.

Description

monsterinsights_tools_url_builder_tab(); 

Usage

  1. if ( !function_exists( 'monsterinsights_tools_url_builder_tab' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-analytics-for-wordpress-by-monsterinsights/includes/admin/pages/tools.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = monsterinsights_tools_url_builder_tab(); 
  7.  

Defined (1)

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

/includes/admin/pages/tools.php  
  1. function monsterinsights_tools_url_builder_tab() { 
  2. ob_start();?> 
  3. <h2><?php echo esc_html__( 'Generate custom campaign parameters for your advertising URLS.', 'google-analytics-for-wordpress' );?></h2> 
  4. <p><?php echo esc_html__( 'The URL builder helps you add parameters to your URLs you use in custom web-based or email ad campaigns. A custom campaign is any ad campaign not using the AdWords auto-tagging feature. When users click one of the custom links, the unique parameters are sent to your Analytics account, so you can identify the urls that are the most effective in attracting users to your content.', 'google-analytics-for-wordpress' ); ?> </p> 
  5. <p><?php echo esc_html__('Fill out the required fields (marked with *) in the form below, and as you make changes the full campaign URL will be generated for you.', 'google-analytics-for-wordpress' ); ?></p> 
  6. <br /> 
  7. <form id="monsterinsights-url-builder" action="javascript:void(0);"> 
  8. <table class="form-table"> 
  9. <tbody> 
  10. <tr> 
  11. <th scope="row"> 
  12. <label for="monsterinsights-url-builer-domain"> 
  13. <?php echo esc_html__( 'Website URL', 'google-analytics-for-wordpress' );?><span class="monsterinsights-required-indicator">*</span> 
  14. </label> 
  15. </th> 
  16. <td> 
  17. <input type="url" name="domain" id="monsterinsights-url-builer-domain" value="" /> 
  18. <p class="description"><?php echo sprintf( esc_html__( 'The full website URL (e.g. %1$s)', 'google-analytics-for-wordpress' ), home_url() );?></p> 
  19. </td> 
  20. </tr> 
  21. <tr> 
  22. <th scope="row"> 
  23. <label for="monsterinsights-url-builer-source"> 
  24. <?php echo esc_html__( 'Campaign Source', 'google-analytics-for-wordpress' );?><span class="monsterinsights-required-indicator">*</span> 
  25. </label> 
  26. </th> 
  27. <td> 
  28. <input type="text" name="source" id="monsterinsights-url-builer-source" value="" /> 
  29. <p class="description"><?php echo sprintf( esc_html__( 'Enter a referrer (e.g. %1$s, %2$s, %3$s)', 'google-analytics-for-wordpress' ), '<code>facebook</code>', '<code>newsletter</code>', '<code>google</code>' );?></p> 
  30. </td> 
  31. </tr> 
  32. <tr> 
  33. <th scope="row"> 
  34. <label for="monsterinsights-url-builer-medium"> 
  35. <?php echo esc_html__( 'Campaign Medium', 'google-analytics-for-wordpress' );?> 
  36. </label> 
  37. </th> 
  38. <td> 
  39. <input type="text" name="medium" id="monsterinsights-url-builer-medium" value="" /> 
  40. <p class="description"><?php echo sprintf( esc_html__( 'Enter a marketing medium (e.g. %1$s, %2$s, %3$s)', 'google-analytics-for-wordpress' ), '<code>cpc</code>', '<code>banner</code>', '<code>email</code>' );?></p> 
  41. </td> 
  42. </tr> 
  43. <tr> 
  44. <th scope="row"> 
  45. <label for="monsterinsights-url-builer-name"> 
  46. <?php echo esc_html__( 'Campaign Name', 'google-analytics-for-wordpress' );?> 
  47. </label> 
  48. </th> 
  49. <td> 
  50. <input type="text" name="name" id="monsterinsights-url-builer-name" value="" /> 
  51. <p class="description"><?php echo sprintf( esc_html__( 'Enter a name to identify the campaign (e.g. %1$s)', 'google-analytics-for-wordpress' ), '<code>spring_sale</code>' );?></p> 
  52. </td> 
  53. </tr> 
  54. <tr> 
  55. <th scope="row"> 
  56. <label for="monsterinsights-url-builer-term"> 
  57. <?php echo esc_html__( 'Campaign Term', 'google-analytics-for-wordpress' );?> 
  58. </label> 
  59. </th> 
  60. <td> 
  61. <input type="text" name="term" id="monsterinsights-url-builer-term" value="" /> 
  62. <p class="description"><?php echo esc_html__( 'Enter the paid keyword', 'google-analytics-for-wordpress' );?></p> 
  63. </td> 
  64. </tr> 
  65. <tr> 
  66. <th scope="row"> 
  67. <label for="monsterinsights-url-builer-content"> 
  68. <?php echo esc_html__( 'Campaign Content', 'google-analytics-for-wordpress' );?> 
  69. </label> 
  70. </th> 
  71. <td> 
  72. <input type="text" name="content" id="monsterinsights-url-builer-content" value="" /> 
  73. <p class="description"><?php echo esc_html__( 'Enter something to differentiate ads', 'google-analytics-for-wordpress' );?></p> 
  74. </td> 
  75. </tr> 
  76. <tr> 
  77. <th scope="row"> 
  78. <label for="monsterinsights-url-builer-fragment"> 
  79. <?php echo esc_html__( 'Use Fragment', 'google-analytics-for-wordpress' );?> 
  80. </label> 
  81. </th> 
  82. <td> 
  83. <input type="checkbox" name="fragment" id="monsterinsights-url-builer-fragment" value="" /> 
  84. <p class="description"><?php echo esc_html__( 'Set the parameters in the fragment portion of the URL (not recommended).', 'google-analytics-for-wordpress' );?></p> 
  85. </td> 
  86. </tr> 
  87. <tr> 
  88. <th scope="row"> 
  89. <label for="monsterinsights-url-builer-url"> 
  90. <?php echo esc_html__( 'URL to use (updates automatically):', 'google-analytics-for-wordpress' );?> 
  91. </label> 
  92. </th> 
  93. <td> 
  94. <textarea name="url" id="monsterinsights-url-builer-url" value="" readonly="readonly"></textarea> 
  95. <p> 
  96. <button class="monsterinsights-copy-to-clipboard monsterinsights-action-button button button-action" data-clipboard-target="#monsterinsights-url-builer-url"> 
  97. <?php echo esc_html__( 'Copy to clipboard' , 'google-analytics-for-wordpress');?> 
  98. </button> 
  99. <button id="monsterinsights-shorten-url" class="monsterinsights-action-button button button-secondary" style="margin-left: 20px;"> 
  100. <?php echo esc_html__( 'Shorten URL' , 'google-analytics-for-wordpress');?> 
  101. </button> 
  102. </p> 
  103. </td> 
  104. </tr> 
  105.  
  106. </tbody> 
  107. </table> 
  108. </form> 
  109. <h2><?php echo esc_html__( 'More information and examples for each option', 'google-analytics-for-wordpress');?></h2> 
  110. <p><?php echo esc_html__( 'The following table gives a detailed explanation and example of each of the campaign parameters.', 'google-analytics-for-wordpress');?></p> 
  111. <table class="wp-list-table widefat striped"> 
  112. <tbody> 
  113. <tr> 
  114. <td> 
  115. <p><strong><?php echo esc_html__( 'Campaign Source', 'google-analytics-for-wordpress');?></strong></p> 
  116. <p><code>utm_source</code></p> 
  117. </td> 
  118. <td> 
  119. <p><strong><?php echo esc_html__( 'Required.', 'google-analytics-for-wordpress');?></strong></p> 
  120. <p><?php echo sprintf( esc_html__( 'Use %1$s to identify a search engine, newsletter name, or other source.', 'google-analytics-for-wordpress'), '<code>utm_source</code>');?></p> 
  121. <p><em><?php echo esc_html__( 'Example:', 'google-analytics-for-wordpress');?></em> <code>google</code></p> 
  122. </td> 
  123. </tr> 
  124. <tr> 
  125. <td> 
  126. <p><strong><?php echo esc_html__( 'Campaign Medium', 'google-analytics-for-wordpress');?></strong></p> 
  127. <p><code>utm_medium</code></p> 
  128. </td> 
  129. <td> 
  130. <p><?php echo sprintf(esc_html__( 'Use %1$s to identify a medium such as email or cost-per- click.', 'google-analytics-for-wordpress'), '<code>utm_medium</code>');?></p> 
  131. <p><em><?php echo esc_html__( 'Example:', 'google-analytics-for-wordpress');?></em> <code>cpc</code></p> 
  132. </td> 
  133. </tr> 
  134. <tr> 
  135. <td> 
  136. <p><strong><?php echo esc_html__( 'Campaign Name', 'google-analytics-for-wordpress');?></strong></p> 
  137. <p><code>utm_campaign</code></p> 
  138. </td> 
  139. <td> 
  140. <p><?php echo sprintf(esc_html__( 'Used for keyword analysis. Use %1$s to identify a specific product promotion or strategic campaign.', 'google-analytics-for-wordpress'), '<code>utm_campaign</code>');?></p> 
  141. <p><em><?php echo esc_html__( 'Example:', 'google-analytics-for-wordpress');?></em> <code>utm_campaign=spring_sale</code></p> 
  142. </td> 
  143. </tr> 
  144. <tr> 
  145. <td> 
  146. <p><strong><?php echo esc_html__( 'Campaign Term', 'google-analytics-for-wordpress');?></strong></p> 
  147. <p><code>utm_term</code></p> 
  148. </td> 
  149. <td> 
  150. <p><?php echo sprintf( esc_html__( 'Used for paid search. Use %1$s to note the keywords for this ad.', 'google-analytics-for-wordpress'), '<code>utm_term</code>');?></p> 
  151. <p><em><?php echo esc_html__( 'Example:', 'google-analytics-for-wordpress');?></em> <code>running+shoes</code></p> 
  152. </td> 
  153. </tr> 
  154. <tr> 
  155. <td> 
  156. <p><strong><?php echo esc_html__( 'Campaign Content', 'google-analytics-for-wordpress');?></strong></p> 
  157. <p><code>utm_content</code></p> 
  158. </td> 
  159. <td> 
  160. <p><?php echo sprintf(esc_html__( 'Used for A/B testing and content-targeted ads. Use %1$s to differentiate ads or links that point to the same URL.', 'google-analytics-for-wordpress'), '<code>utm_content</code>');?></p> 
  161. <p><em><?php echo esc_html__( 'Examples:', 'google-analytics-for-wordpress');?></em> <code>logolink</code> <em><?php echo esc_html__( 'or', 'google-analytics-for-wordpress');?></em> <code>textlink</code></p> 
  162. </td> 
  163. </tr> 
  164. </tbody> 
  165. </table> 
  166.  
  167. <h2 id="monsterinsights-related-resources"><?php echo esc_html__( 'More information:', 'google-analytics-for-wordpress');?></h2> 
  168.  
  169. <ul id="monsterinsights-related-resources-list"> 
  170. <li><a href="https://support.google.com/analytics/answer/1247851"><?php echo esc_html__( 'About Campaigns', 'google-analytics-for-wordpress');?></a></li> 
  171. <li><a href="https://support.google.com/analytics/answer/1033863"><?php echo esc_html__( 'About Custom Campaigns', 'google-analytics-for-wordpress');?></a></li> 
  172. <li><a href="https://support.google.com/analytics/answer/1037445"><?php echo esc_html__( 'Best practices for creating Custom Campaigns', 'google-analytics-for-wordpress');?></a></li> 
  173. <li><a href="https://support.google.com/analytics/answer/1247839"><?php echo esc_html__( 'About the Referral Traffic report', 'google-analytics-for-wordpress');?></a></li> 
  174. <li><a href="https://support.google.com/analytics/answer/1033173"><?php echo esc_html__( 'About traffic source dimensions', 'google-analytics-for-wordpress');?></a></li> 
  175. <li><a href="https://support.google.com/adwords/answer/1752125"><?php echo esc_html__( 'AdWords Auto-Tagging', 'google-analytics-for-wordpress');?></a></li> 
  176. </ul> 
  177. <?php 
  178. echo ob_get_clean();