• CF7 Is an awesome plugin, but I’m having great difficulty trying to figure out how to track LinkedIn (pixel) form submissions.

    I have my pixel code (in addition to the main LinkedIn Insight tag), which I have added to the page the form sits on:

    <img height="1" width="1" style="display:none;" alt="" src="https://dc.ads.linkedin.com/collect/?pid=xxxxxx&conversionId=xxxxxx&fmt=gif" />

    But this fires each time the page is loaded. I have read about DOM events:
    https://contactform7.com/dom-events/

    …And there is a tutorial for Google Analytics events:
    https://contactform7.com/2017/06/07/on-sent-ok-is-deprecated/

    …But I can’t understand how to make this work for LinkedIn pixels.

    Any help appreciated.

    • This topic was modified 6 years, 8 months ago by elsmore.
Viewing 1 replies (of 1 total)
  • Something like that in your functions.php

    add_action( 'wp_footer', 'mycustom_wp_footer' );
    function mycustom_wp_footer() {
     ?>
    <script>
    document.addEventListener( 'wpcf7mailsent', function( event ) {
       if ( 'FORM-ID-HERE' == event.detail.contactFormId ) {
    var liPixelSrc = "https://dc.ads.linkedin.com/collect/?pid=XXXXX&conversionId=XXXXXX&fmt=gif";  
        var liPixel = new Image();      
        liPixel.src = liPixelSrc;   
        return false; 
      };  
    }, false );
    </script>	
    <?php
    }
    
Viewing 1 replies (of 1 total)
  • The topic ‘Tracking LinkedIn pixel form submissions’ is closed to new replies.