You can export the UTM report in Contact Form 7 with Flamingo by adding the following custom code to your theme’s functions.php file.
Custom code is required because Flamingo does not have a hook in their Flamingo_Inbound_CSV PHP class. However Flamingo provides developers the capability to fully override their Flamingo_Inbound_CSV PHP class by calling your own PHP class.
Why have we not included this code as part of our AFL UTM Tracker plugin?
It is because the Flamingo plugin only allows one custom file to override the existing Flamingo_Inbound_CSV PHP class. This means if we include this file as part of our plugin, a different plugin will not be able to add custom column into the CSV file.
- AFL UTM Tracker v2.9.0
- Contact Form 7 v5.7.1
- Flamingo v2.4.0
You will need basic PHP knowledge for this tutorial.
- Open your theme’s functions.php in a file editor.
- Copy the code below and paste into the functions.php file. Ignore the Line 1 below if your functions.php already has the PHP open tag.
- Test the code in your staging site first before making changes to production.
- To test the code, go to your WordPress dashboard.
- Go to Flamingo > Inbound Messages.
- Click on the Export button.
- Finally check the downloaded CSV file to see if the UTM report is included.