Created
December 18, 2014 17:38
-
-
Save HiroAgustin/cbebd3f7397d196ee1c8 to your computer and use it in GitHub Desktop.
Include facebook, twitter and analytics scripts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;(function (win, doc, s, js, fjs, inc, ga) | |
| { | |
| 'use strict'; | |
| fjs = doc.getElementsByTagName(s)[0]; | |
| inc = function (src) | |
| { | |
| js = doc.createElement(s); | |
| js.src = src; | |
| js.async = 1; | |
| fjs.parentNode.insertBefore(js, fjs); | |
| }; | |
| // <!-- Facebook Share Button --> | |
| // https://developers.facebook.com/docs/javascript/quickstart/v2.0#loading | |
| win.fbAsyncInit = function () | |
| { | |
| FB.init({ | |
| appId: '' | |
| , xfbml: true | |
| , version: 'v2.0' | |
| }); | |
| }; | |
| inc('//connect.facebook.net/en/sdk.js'); | |
| // <!-- End Facebook Share Button --> | |
| // <!-- Twitter Button --> | |
| inc('//platform.twitter.com/widgets.js'); | |
| // <!-- End Twitter Button --> | |
| // <!-- Google Analytics --> | |
| inc('//www.google-analytics.com/analytics.js'); | |
| win.GoogleAnalyticsObject = 'ga'; | |
| ga = win.ga = function () | |
| { | |
| (win.ga.q = win.ga.q || []).push(arguments); | |
| }; | |
| ga.l = 1 * new Date(); | |
| ga('create', 'UA-', 'auto'); | |
| ga('send', 'pageview'); | |
| // <!-- End Google Analytics --> | |
| }(window, document, 'script')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment