emanuel1109

mvr - moves - web

Jul 20th, 2022 (edited)
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // fire this snippet before the Google Tag Manager snippet everytime that page loads
  2. window.dataLayer = window.dataLayer || [];
  3. window.dataLayer.push({
  4.   'event' : 'user_status',
  5.   'user_id' : 'insert_user_id_here', // insert the user id like it appears in the database
  6.   'user_sub_status' : 'insert_user_sub_status' // 'free trial', 'canceled', 'monthly', 'yearly', 'expired'
  7. });
  8.  
  9. // This event fires on any click of 'Start Free Trial' (on any button that redirects to start a free trial), no matter where it is
  10. window.dataLayer.push({
  11.   'event' : 'cta_clicked'
  12. });
  13.  
  14. // This event fires when a user clicks to start the survey
  15. window.dataLayer = window.dataLayer || [];
  16. window.dataLayer.push({
  17.   'event' : 'survey_started',
  18.   'type' : 'optional' // insert the type of the survey optional/mandatory (as far as I know, there is no mandatory surveys on web)
  19. });
  20.  
  21. // This event fires when a user clicks to skip the survey
  22. window.dataLayer = window.dataLayer || [];
  23. window.dataLayer.push({
  24.   'event' : 'survey_skipped'
  25. });
  26.  
  27. // This event fires when a user finishes the survey, if the user checks the 'I am a yoga instructor' checkbox, capture that information as well
  28. window.dataLayer = window.dataLayer || [];
  29. window.dataLayer.push({
  30.   'event' : 'survey_finished',
  31.   'type' : 'optional',
  32.   'is_instructor' : 'true/false' // 'true' or 'false' depends on the answer, default value: "false"
  33. });
  34.  
  35. // This event fires when a user starts the sign up (either clicks on Apple/Facebook button, or fills any of the fields for the email signup)
  36. window.dataLayer = window.dataLayer || [];
  37. window.dataLayer.push({
  38.   'event' : 'sign_up_started',
  39.   'method' : 'email/facebook/apple' // method of registration (how the user initiated signup)
  40. });
  41.  
  42. // This event fires when a user completes the signup
  43. window.dataLayer = window.dataLayer || [];
  44. window.dataLayer.push({
  45.   'event' : 'sign_up_completed',
  46.   'user_id' : 'insert_user_id_here', // insert the user id from the database here
  47.   'method' : 'email/facebook/apple' // method of registration (how the user initiated signup)
  48. });
  49.  
  50. // This event fires when a user redeems his unique code (redemption pages only)
  51. window.dataLayer = window.dataLayer || [];
  52. window.dataLayer.push({
  53.   'event' : 'code_redeemed',
  54.   'promo_code' : 'insert_promo_code_here' // insert promo code here
  55. });
  56.  
  57. // This event fires when a user clicks to 'activate membership' if he is on a free trial or clicks on 'sign up' after his membership expired
  58. window.dataLayer = window.dataLayer || [];
  59. window.dataLayer.push({
  60.   'event' : 'activation_initiated'
  61. });
  62.  
  63. // This event fires when a user finishes to 'activate membership' after his membership expired (or he is on free trial and decided to upgrade)
  64. window.dataLayer = window.dataLayer || [];
  65. window.dataLayer.push({
  66.   event: 'purchase',            // name of the event. In this case, it always must be purchase
  67.   ecommerce: {
  68.     currency: 'USD', // leave static if user can only be charged with USD
  69.     value: 29.98,                       // order total (excluding tax) (the amount the user paid when he activated the plan excluding tax)
  70.     tax: 2.00, // insert tax (if available or exist in the store)
  71.     affiliation: 'alomoves',  // insert store name region here
  72.     transaction_id: 'abc123',           // transaction id
  73.     coupon: 'ENDOFSUMMER',          // if coupon was applied to the order, include it here          
  74.     items: [{                           // an array with all products
  75.       item_name: 'membership activated - monthly/annually', // monthly or annually depends on the plan the user chose
  76.       item_id: 'membership activated - monthly/annually',   // monthly or annually depends on the plan the user chose
  77.       item_category: 'membership', // leave static
  78.       price: 11.99,                 // insert an actual product price. Number or a string. Don't include currency code
  79.       quantity: '1',                    // product quantity. leave static
  80.     }]
  81.   }
  82. });
  83.  
  84. // This event fires when a user chose a payment plan, captures the payment plan chosen and any coupon code that was added
  85. window.dataLayer = window.dataLayer || [];
  86. window.dataLayer.push({
  87.   'event' : 'payment_plan_chosen',
  88.   'type' : 'monthly/annually', // payment plan type
  89.   'promo_code' : 'insert_promo_code_here' // insert promo code here, if not available then keep it empty ''
  90. });
  91.  
  92. // This event fires after a user placed his credit card information on Stripe and his trial started
  93. window.dataLayer = window.dataLayer || [];
  94. window.dataLayer.push({
  95.   'event': 'trial_started',          
  96.   'name': '14 Days Trial - Annual/Monthly', // Annual or Monthly depends on the trial he started
  97.   'promo_code': 'insert_coupon_name_here'       // if the user used any coupon please list it here    
  98. });
  99.  
  100. // This event fires whenever a user completes the redeeming of membership using the GWP 30-Day Trial code
  101. window.dataLayer = window.dataLayer || [];
  102. window.dataLayer.push({
  103.   'event': 'trial_started',          
  104.   'name': '30 Days Trial - Monthly', // users who use GWP 30-Day Trial code renew monthly
  105.   'promo_code': 'insert_coupon_name_here'       // insert the coupon the user used here    
  106. });
  107.  
  108. // This event fires whenever a user completes the redeeming of membership (has to enter payment information) and gets 365 days trial
  109. window.dataLayer = window.dataLayer || [];
  110. window.dataLayer.push({
  111.   'event': 'trial_started',          
  112.   'name': '12 Months Trial - Monthly', // it renews monthly
  113.   'promo_code': 'insert_coupon_name_here'  // insert the coupon the user used here        
  114. });
  115.  
  116. // This event fires whenever a user completes the redeeming of membership (without entering payment information)  and gets 365 days trial (the user has to activate the membership during or after the membership expired)
  117. window.dataLayer = window.dataLayer || [];
  118. window.dataLayer.push({
  119.   'event': 'trial_started',          
  120.   'name': '6/12 Months Trial - Non Renewing', // 6 or 12 depends on the page/coupon
  121.   'promo_code': 'insert_coupon_name_here'  // insert the coupon the user used here        
  122. });
  123.  
  124. // This event fires when a user has a class viewed (on page load of a class)
  125. window.dataLayer = window.dataLayer || [];
  126. window.dataLayer.push({
  127.   'event' : 'class_viewed',
  128.   'class' : 'insert_class_name_here', // insert the class name here
  129.   'series' : 'insert_series_name_here, // insert the series name here
  130.  'difficulty' : 'insert_difficulty_here', // insert the difficulty here
  131.  'intensity' : 'insert_intesity_here', // insert the intensity here
  132.  'instructor' : 'insert_class_instructor_name' // insert the instructor here
  133. });
  134.  
  135. // This event fires when a user has a user saved a class
  136. window.dataLayer = window.dataLayer || [];
  137. window.dataLayer.push({
  138.  'event' : 'class_saved',
  139.  'class' : 'insert_class_name_here', // insert the class name here
  140.  'series' : 'insert_series_name_here, // insert the series name here
  141.   'difficulty' : 'insert_difficulty_here', // insert the difficulty here
  142.   'intensity' : 'insert_intesity_here', // insert the intensity here
  143.   'instructor' : 'insert_class_instructor_name' // insert the instructor here
  144. });
  145.  
  146. // This event fires when a user adds a class to his playlist
  147. window.dataLayer = window.dataLayer || [];
  148. window.dataLayer.push({
  149.   'event' : 'added_to_playlist',
  150.   'class' : 'insert_class_name_here', // insert the class name here
  151.   'series' : 'insert_series_name_here, // insert the series name here
  152.  'difficulty' : 'insert_difficulty_here', // insert the difficulty here
  153.  'intensity' : 'insert_intesity_here', // insert the intensity here
  154.  'instructor' : 'insert_class_instructor_name' // insert the instructor here
  155. });
  156.  
  157. // This event fires when a user has opened a series page (on page load of a series)
  158. window.dataLayer = window.dataLayer || [];
  159. window.dataLayer.push({
  160.  'event' : 'series_viewed',
  161.  'series' : 'insert_series_name_here, // insert series name here
  162.   'difficulty' : 'insert_difficulty_here', // insert the difficulty here
  163.   'intensity' : 'insert_intesity_here', // insert the intensity here
  164.   'instructor' : 'insert_class_instructor_name' // insert the instructor here
  165. });
  166.  
  167. // This event fires when a user adds a series to his practice
  168. window.dataLayer = window.dataLayer || [];
  169. window.dataLayer.push({
  170.   'event' : 'series_saved', // when the user clicks the 'add to practice' button
  171.   'series' : 'insert_series_name_here, // insert series name here
  172.  'difficulty' : 'insert_difficulty_here', // insert the difficulty here
  173.  'intensity' : 'insert_intesity_here', // insert the intensity here
  174.  'instructor' : 'insert_class_instructor_name' // insert the instructor here
  175. });
  176.  
  177. // This event fires when a user plays the series intro video, usually the video next to the series description on the series page
  178. window.dataLayer = window.dataLayer || [];
  179. window.dataLayer.push({
  180.  'event' : 'series_intro_played',
  181.  'series' : 'insert_series_name_here, // insert series name here
  182.   'difficulty' : 'insert_difficulty_here', // insert the difficulty here
  183.   'intensity' : 'insert_intesity_here', // insert the intensity here
  184.   'instructor' : 'insert_class_instructor_name' // insert the instructor here
  185. });
  186.  
  187. // This event fires when a user views an instructor page (on page load of an instructor)
  188. window.dataLayer = window.dataLayer || [];
  189. window.dataLayer.push({
  190.   'event' : 'instructor_viewed',
  191.   'instructor' : 'insert_class_instructor_name' // insert instructor name here
  192. });
  193.  
  194. // This event fires when a user plays a video
  195. window.dataLayer = window.dataLayer || [];
  196. window.dataLayer.push({
  197.   'event' : 'video_played',
  198.   'title' : 'insert_video_name_here', // insert video title (could be the name of the class)
  199.   'class' : 'insert_class_name_here', // insert class name
  200.   'series' : 'insert_series_name_here', // insert the series that video is part of
  201.   'difficulty' : 'insert_difficulty_here', // insert difficulty here
  202.   'intensity' : 'insert_intesity_here', // insert intensity here
  203.   'instructor' : 'insert_class_instructor_name' // insert instructor here
  204. });
  205.  
  206. // This event fires every 10 seconds when a video is being played
  207. window.dataLayer = window.dataLayer || [];
  208. window.dataLayer.push({
  209.   'event' : 'video_watched_time',
  210.   'duration' : 10, // insert duration watched in seconds
  211.   'title' : 'insert_video_name_here', // insert video title (could be the name of the class)
  212.   'class' : 'insert_class_name_here', // insert class name
  213.   'series' : 'insert_series_name_here', // insert the series that video is part of
  214.   'difficulty' : 'insert_difficulty_here', // insert difficulty here
  215.   'intensity' : 'insert_intesity_here', // insert intensity here
  216.   'instructor' : 'insert_class_instructor_name' // insert instructor here
  217. });
  218.  
  219. // This event fires each time a user views a certain threshold of duration of the video (when a user views 10% of the video, 25%, 50%, 75%, 90%)
  220. window.dataLayer = window.dataLayer || [];
  221. window.dataLayer.push({
  222.   'event' : 'video_watched_percent',
  223.   'percent' : 10 // or 25, 50, 75, 90
  224.   'title' : 'insert_video_name_here', // insert video title (could be the name of the class)
  225.   'class' : 'insert_class_name_here', // insert class name
  226.   'series' : 'insert_series_name_here', // insert the series that video is part of
  227.   'difficulty' : 'insert_difficulty_here', // insert difficulty here
  228.   'intensity' : 'insert_intesity_here', // insert intensity here
  229.   'instructor' : 'insert_class_instructor_name' // insert instructor here
  230. });
  231.  
  232. // This event fires when a user finishes watching a video
  233. window.dataLayer = window.dataLayer || [];
  234. window.dataLayer.push({
  235.   'event' : 'video_finished',
  236.   'title' : 'insert_video_name_here', // insert video title (could be the name of the class)
  237.   'class' : 'insert_class_name_here', // insert class name
  238.   'series' : 'insert_series_name_here', // insert the series that video is part of
  239.   'difficulty' : 'insert_difficulty_here', // insert difficulty here
  240.   'intensity' : 'insert_intesity_here', // insert intensity here
  241.   'instructor' : 'insert_class_instructor_name' // insert instructor here
  242. });
  243.  
  244. // This event fires when a user toggles music on a video (only when he toggles that on)
  245. window.dataLayer = window.dataLayer || [];
  246. window.dataLayer.push({
  247.   'event' : 'music_toggled',
  248.   'title' : 'insert_video_name_here', // insert video title (could be the name of the class)
  249.   'class' : 'insert_class_name_here', // insert class name
  250.   'series' : 'insert_series_name_here', // insert the series that video is part of
  251.   'difficulty' : 'insert_difficulty_here', // insert difficulty here
  252.   'intensity' : 'insert_intesity_here', // insert intensity here
  253.   'instructor' : 'insert_class_instructor_name' // insert instructor here
  254. });
  255.  
  256. // This event fires when a user filters the duration
  257. window.dataLayer = window.dataLayer || [];
  258. window.dataLayer.push({
  259.   'event' : 'duration_filtered',
  260.   'filter_value' : 'insert_value_chosen' // insert the value of the filter that was chosen
  261. });
  262.  
  263. // This event fires when a user filters the instructor
  264. window.dataLayer = window.dataLayer || [];
  265. window.dataLayer.push({
  266.   'event' : 'instructor_filtered',
  267.   'filter_value' : 'insert_value_chosen' // insert the value of the filter that was chosen
  268. });
  269.  
  270. // This event fires when a user filters the style
  271. window.dataLayer = window.dataLayer || [];
  272. window.dataLayer.push({
  273.   'event' : 'style_filtered',
  274.   'filter_value' : 'insert_value_chosen' // insert the value of the filter that was chosen
  275. });
  276.  
  277. // This event fires when a user filters the difficulty
  278. window.dataLayer = window.dataLayer || [];
  279. window.dataLayer.push({
  280.   'event' : 'difficulty_filtered',
  281.   'filter_value' : 'insert_value_chosen' // insert the value of the filter that was chosen
  282. });
  283.  
  284. // This event fires when a user filters the intensity
  285. window.dataLayer = window.dataLayer || [];
  286. window.dataLayer.push({
  287.   'event' : 'intensity_filtered',
  288.   'filter_value' : 'insert_value_chosen' // insert the value of the filter that was chosen
  289. });
  290.  
  291. // This event fires when a user uses the sort function
  292. window.dataLayer = window.dataLayer || [];
  293. window.dataLayer.push({
  294.   'event' : 'sorted_by',
  295.   'filter_value' : 'insert_value_chosen' // insert the value of the filter that was chosen
  296. });
Advertisement
Add Comment
Please, Sign In to add comment