Web888.vn
  • Shop
  • Blog
Đăng nhập
  • Đăng nhập / Đăng ký

Please enter key search to display results.

Home
  • Google Adsense
  • Google adwords
Set up contact form 7 event conversions for google adwords & google analytics using tag manager

Set up contact form 7 event conversions for google adwords & google analytics using tag manager

  • 28-07-2022
  • trienkhaiweb
  • 0 Comments

If you are currently in need of a solution that fits the following criteria, take a close look at this article:

  1. You are currently using the contact form 7 plugin on your WordPress site.
  2. You want to catch the contact form submission event as a conversion goal in Google google adwords.
  3. You have implemented Google Analytics on your website using Google Tag Manager.

Mục lục

  • Step 1: Log in to google tag manager and create a tag
  • Step 2: Create a GTM Trigger (GTM Trigger)
  • Step 3: Go back to the tag generator (Tag)
  • Step 4: Create variable on google tag manager.
  • Step 5: Continue to install google analytics with the events created in the previous steps.

Step 1: Log in to google tag manager and create a tag

First of all, and a very important note: make sure your tagmanager code has been correctly included in the header of your website according to google’s instructions. (Note this part is not in the video article). Go to https://tagmanager.google.com Tag configuration: Tag Type: Custom HTML -> Tag type: Custom HTML paste this code in

<script>
document . addEventListener ( ‘wpcf7mailsent’ , function ( event ) {
dataLayer . push ( {
‘event’ : ‘wpcf7successfulsubmit’ ,
‘CF7formID’ : event . detail . contactFormId
} ) ;
} , false ) ;
</script>
The wpcf7mailsent event is the event provided by the contactform7 plugin (generated when the contact form 7 submits successfully), then uses the push function (adds an element to the array) to save the value into the dataLayer variable, here there are 2 event variables. has the value: wpcf7successfulsubmit (represents the successful form submission event, pay attention to properly configure this variable to use for step 2), the CF7formId variable stores the value of the form ID that submits the event.
The dataLayer variable is a concept of google tag manager, if you want to dig deeper you can visit:
https://github.com/google/data-layer-helper
Set up contact form 7 event conversion for google adwords & google analytics with tag manager

Triggering: Select the trigger: All Pages if you want to catch this event site-wide. This section means that this successful form submission event will be caught on your entire website, you can completely configure this form submission event separately on each detail page in case you use an ad campaign. advertising for many different landing pages and need to measure the effectiveness and customer behavior of each subpage.

In the demo video, I use it in the actual case that I want to get the form information submitted by the customer from a purchase page.

We name the tag CF7 listener, click save . Set up contact form 7 event conversion for google adwords & google analytics with tag manager

Step 2: Create a GTM Trigger (GTM Trigger)

Select the custom event trigger, fill in the new ” wpcf7successfulsubmit ” event variable declared above , name the trigger as you wish and click save.

Step 3: Go back to the tag generator (Tag)

Tag type (tag type): google ads conversion tracking Back to your google adwords page, go to “Tools and settings” -> Measurement -> Conversions Click the (+) button to generate conversions, after configuration click “create and continue”. After successful creation, google redirects the interface to the tag setup section, select (“use google tag manager).Copy the conversion ID and conversion label and paste it to the side of google tag manager’s tag configuration and save it. back with both tagmanager & google ads.At the trigger configuration section of this tag, select the trigger you just created in step 2.At this step it’s almost done, you can skip step 4, however, , I encourage you to do it to understand more about the google tag manager tool.

Step 4: Create variable on google tag manager.

In this step, we create one more variable on the google tag manager CF7formID, which receives the formID value from the user’s form submit event. Then go back to the google ads Conversion Tracking Tag and select the CF7formID variable for the Conversion Value field. Then click Publish. If you watch the video, you will see that google provides a preview feature to debug whether the events and variables are correct.

Step 5: Continue to install google analytics with the events created in the previous steps.

Tag type: google analytics:Universal Analytics Setting is similar to step 3 (watch the video for better understanding). The article is translated and developed from the original article: https://chrisberkley.com/blog/contact-form-7-event-tracking-google-tag-manager/ If you find the article interesting, please share to Motivate the team to make more quality videos!

Bài viết liên quan:

Instructions on how to run Google ads from AZ for newbies

THÊM BÌNH LUẬN Cancel reply

Dịch vụ thiết kế Wesbite

NỘI DUNG MỚI CẬP NHẬT

Step-by-step guide to installing Microsoft SQL Server and connecting to the database for beginners

Reasons Why People Are Increasingly Inexperienced in Life

PHP Data Types

Table (table) in SQL Server

Basic data types in C

Giới thiệu

web888.vn là chuyên trang chia sẻ và cập nhật tin tức công nghệ, chia sẻ kiến thức, kỹ năng. Chúng tôi rất cảm ơn và mong muốn nhận được nhiều phản hồi để có thể phục vụ quý bạn đọc tốt hơn !

Liên hệ quảng cáo: [email protected]

Kết nối với web888

© web888.vn - Tech888 Co .Ltd since 2019

Đăng nhập

Trở thành một phần của cộng đồng của chúng tôi!
Registration complete. Please check your email.
Đăng nhập bằng google
Đăng kýBạn quên mật khẩu?

Create an account

Welcome! Register for an account
The user name or email address is not correct.

Your personal data will be used to support your experience throughout this website, to manage access to your account, and for other purposes described in our privacy policy.

Registration confirmation will be emailed to you.
Log in Lost your password?

Reset password

Recover your password
Password reset email has been sent.
The email could not be sent. Possible reason: your host may have disabled the mail function.
A password will be e-mailed to you.
Log in Register
×