Twitter now creates code to track visits to your site from twitter. https://support.twitter.com/articles/20170807-conversion-tracking-for-websites#

Where would be the best place to put this code, into a template? is there a module for this like there is for google analytics?

1 Answer 1


The proper way is to use hook_page_alter() in your template.php or a custom module. But there's also a module out there to accomplish this task:

Take a look at the module Tracking Code. It allows you to inject arbitrary code inside <HEAD>, after <BODY> or before </BODY>.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.