We have a snippet of code that was provided by an optimization platform company we use that provides a real-time personalization to our website.
The user will fill out a form (Gravity Forms) and then be sent to one of our WordPress Thank You pages.
This code will be added to the Thank You page, but needs to be updated to capture the user's email address once the Gravity Form has been completed:
<img src="//dasd65f4ds3e25u.cloudfront.net/pc/p5w6g1jy/?e=[customer's email address]" id="__tms_pc" height="1" width="1" />
Would you be able to help me replace the "customer's email address" text with the appropriate code that will be able to capture each user's email address when they fill out the form?
Is there a PHP string of code that could be used to replace the "customer's email address" text? I have not been able to find a concrete answer while doing some research for this.
Edit append: We need to add the tracking script and form submission image to the thank you page. To do this we added the tracking script in Google Tag Manager.
The next step is to add the tracking image to the confirmation/thank you page. This is the script I put in my original question. This script is a purchase complete tracking script for the form confirmation/thank you page after the form has been filled out. This is to record when a user completes the form and remove the user form abandoned campaigns.
The instructions mention replacing the placeholder text [customer's email address] with the code to merge the user's actual email address in the URL. This code can not be added to Google Tag Manager, so we will need to modify the page's HTML. We use WordPress and I am thinking this mentioned code can be added to the confirmation/thank you page.
I reached out to Gravity Forms about this question, and here is their response: "You can configure your form confirmation to redirect to your thank you page and include the email provided using a query string, example: https://d.pr/i/0jljog
That would pass the actual value for the email provided by the user to your thank you page. But the snippet that the optimization platform company provided you is intended to just display an image with a query string, that's the only thing it can do.
Therefore even if you configure your form to pass the value to the page as explained above, you still need to put some code in the page to get the value form the query string and pass it to the snippet. So you will need to ask the optimization platform company about this."