mediapop / django-friendface

Getting Facebook to work for Django.
2 stars 0 forks source link

Add a way to include tracking pixels. #80

Open kitsunde opened 11 years ago

kitsunde commented 11 years ago

They look like this.

<script>
    var fb_param = {};
    fb_param.pixel_id = '6008364088427';
    fb_param.value = '0.00';
    (function(){
      var fpw = document.createElement('script');
      fpw.async = true;
      fpw.src = '//connect.facebook.net/en_US/fp.js';
      var ref = document.getElementsByTagName('script')[0];
      ref.parentNode.insertBefore(fpw, ref);
    })();
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/offsite_event.php?id=6008364088427&amp;value=0" /></noscript>

We could do:

  1. {% facebook_tracking id='6008364088427' value='0.00' %}
  2. Create a model and do {% facebook_tracking name='create_promotion' %}
  3. URL matching and auto-include it through {% include 'friendface/header.html' '%}