Title: Random code calls
Last modified: March 21, 2019

---

# Random code calls

 *  Resolved [funsail](https://wordpress.org/support/users/funsail/)
 * (@funsail)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/random-code-calls/)
 * I see you do dfault GA. Can you do FB?
 * on_sent_ok: “fbq(‘track’, etc

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Kaspars](https://wordpress.org/support/users/kasparsd/)
 * (@kasparsd)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/random-code-calls/#post-11345168)
 * That’s a great suggestion! I’ve opened [an issue on GitHub](https://github.com/kasparsd/contact-form-7-extras/issues/29)
   to track this feature.
 *  Plugin Author [Kaspars](https://wordpress.org/support/users/kasparsd/)
 * (@kasparsd)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/random-code-calls/#post-11345417)
 * [@funsail](https://wordpress.org/support/users/funsail/) This has been added 
   in version 0.7.0 of the plugin.
 *  Thread Starter [funsail](https://wordpress.org/support/users/funsail/)
 * (@funsail)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/random-code-calls/#post-11355822)
 * Thanks. That is fantastic and so fast!
 * Can you consider splitting GA,FB into fields, so we can enter custom events with
   category
 * Eg I may have
    ga(‘gaTracker.send’, ‘event’, ‘ContactForm’, ‘Send’); or ga(‘gaTracker.
   send’, ‘event’, ‘SupportForm’, ‘Send’);
 * For FB it’s more complex
    fbq(‘track’, ‘Lead’, {content_name: ‘ContactForm’, 
   content_category: ‘Cars’}); or fbq(‘track’, ‘Lead’, {content_name: ‘ContactForm’,
   content_category: ‘Boats’}); or some people have more fields
 * Problem with FB there is only 1 pixel, if I use across 2 items or sites, I can’t
   tell where the click came from.
    -  This reply was modified 7 years, 1 month ago by [funsail](https://wordpress.org/support/users/funsail/).
 *  Thread Starter [funsail](https://wordpress.org/support/users/funsail/)
 * (@funsail)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/random-code-calls/#post-11356511)
 * I guess if GA had the option name=‘ContactForm’
 * I think FB would be always ‘Lead’ so you just need a free field
    payload=”{content_name:‘
   ContactForm’, content_category: ‘Boats’}”
 * So it’s just 1 field each.
 *  Plugin Author [Kaspars](https://wordpress.org/support/users/kasparsd/)
 * (@kasparsd)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/random-code-calls/#post-11382174)
 * These are great suggestions, similar to [what was mentioned in this support thread](https://wordpress.org/support/topic/capturing-form-drop-down-field-datalayer/).
 * What are your thoughts on having a free-form input field with references to input
   field IDs that would be passed as event action in addition to the default submit/
   spam/fail events?
 *  Thread Starter [funsail](https://wordpress.org/support/users/funsail/)
 * (@funsail)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/random-code-calls/#post-11382242)
 * I’m not sure if it’s going to be too much work. You’d need at least 2 option 
   sets
 * GA we can get away with just 1 form name
    ga(‘gaTracker.send’, ‘event’, ‘ContactForm’,‘
   Send’); or ga(‘gaTracker.send’, ‘event’, ‘SupportForm’, ‘Send’);
 * For FB it’s much more complex
    fbq(‘track’, ‘Lead’, {content_name: ‘ContactForm’,
   content_category: ‘Cars’}); or fbq(‘track’, ‘Lead’, {content_name: ‘ContactForm’,
   content_category: ‘Boats’, other_stuff});
 * I don’t even know what you’d do, other than to leave a free field for generic
   js.
 * I think the best way would have been a textfield for random js, and I’d just 
   put in
 *     ```
       ga(‘gaTracker.send’, ‘event’, ‘ContactForm’, ‘Send’);
       fbq(‘track’, ‘Lead’, {content_name: ‘ContactForm’, content_category: ‘Cars’});
       ```
   
 * and also do other field manipulation if I want

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Random code calls’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7-extras/assets/icon-256x256.png?rev=1917847)
 * [Controls for Contact Form 7 (Redirects, Analytics & Tracking)](https://wordpress.org/plugins/contact-form-7-extras/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7-extras/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7-extras/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7-extras/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7-extras/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7-extras/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [funsail](https://wordpress.org/support/users/funsail/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/random-code-calls/#post-11382242)
 * Status: resolved