איבנט לגוגל אנליטיקס + עמוד תודה WPCF7

איבנט לגוגל אנליטיקס + עמוד תודה WPCF7

// CF7 ANALYTCS EVENT
add_action( 'wp_footer', 'mycustom_wp_footer' );
 
function mycustom_wp_footer() {
?>
<!-- WPCF7 EVENT FOR ANALYTICS -->
<script type="text/javascript">
document.addEventListener( 'wpcf7mailsent', function( event ) {
    ga( 'send', 'event', 'Contact Form', 'submit' );
}, false );
</script>
<?php
}

 

Google Analytics Event Tracking Code for a General Event

מיועד לספירט יעדים / המרות של לחיצות על קישורים. טוב להמרות של כל מיני כפתורי מובייל וטלפון למינהם

להוסיף לקישור

onClick="ga('send', 'event', { eventCategory: 'general', eventAction: 'click', eventLabel: 'waze click', eventValue: 1});"

ככה אמור להיראות

הקישור שלי

שלב הבא: הגדרות גוגל אנליטיקס

After you add the event tracking code to your site, you may want to setup a goal in Google Analytics that's related to the event. Follow these instructions to setup the goal.

  1. Login to Google Analytics and click on Admin in the main navigation.
  2. Select the Account and Property where you want to create the goal. Under the View list, click on Goals
  3. Click on the New Goal button, click on the Custom radio button and then click on the Next stepbutton.
  4. Name the goal and select the Event radio button.
  5. Populate all of the relevant goal details (in bold):
    • Category | that matches | general
    • Action | that matches | click
    • Label | that matches | waze click
    • Value | that matches | 1
  6. Click the Create Goal button. You're done!

 

מקור:

https://raventools.com/marketing-reports/google-analytics/event-tracking/general-event/

 

קוד נוסף לטפסים שהם לא WPCF7

$("#myform").submit(function(event) {

// do the task here ..

});

קוד איבנט עבור ביצוע הזמנה בווקומרס

if(jQuery('.place_order')){
	jQuery(this).submit(function(event){
		ga('send', 'event', { eventCategory: 'general', eventAction: 'click', eventLabel: 'order', eventValue: 1});
	})
}

Thankyou Page או דף תודה הפנייה לעמוד תודה לאחר שליחת טופס מוצלחת

add_action( 'wp_footer', 'mycustom_wp_footer' );
 
function mycustom_wp_footer() {
?>
<script type="text/javascript">
document.addEventListener( 'wpcf7mailsent', function( event ) {
    window.location.replace("http://your_thank_you_page");
}, false );
</script>
<?php
}