Advertisement
Guest User

tracking

a guest
Jan 24th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. == Code from page ==
  2.  
  3. {% includeJsFile "http://craft/js/tracking.js" %}
  4. {% set myJs %}
  5. loadScript("{{entry.title}}");
  6. {% endset %}
  7. {% includeJs myJs %}
  8.  
  9. == included js==
  10.  
  11. function loadScript(entryTitle){
  12. var script = document.createElement('script');
  13. script.innerHTML = "fbq('track',this.entryTitle)";
  14. document.body.prepend(script);
  15. console.log('entryTitle: ' + entryTitle);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement