Last active
May 26, 2016 09:03
-
-
Save chhib/a3b8d7d5ee81f889a91f5af3557d05b6 to your computer and use it in GitHub Desktop.
Keyword Provider Google Analytics plugin method for custom dimensions
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
| <!-- Google Analytics Snippet --> | |
| <script> | |
| (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
| (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
| m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
| })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
| ga('create', 'UA-1234-5', 'auto'); | |
| // Add this before the send pageview call | |
| ga('require', 'RoyAppKeywordProvider'); | |
| ga('send', 'pageview'); | |
| </script> |
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
| <!-- Google Analytics Snippet --> | |
| <script> | |
| (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
| (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
| m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
| })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
| ga('create', 'UA-1234-5', 'auto'); | |
| ga('send', 'pageview'); | |
| </script> |
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
| <!-- Roy App Keyword Provider snippet --> | |
| <script> | |
| (function (window) { | |
| window['RoyAppKeywordProviderConfig'] = { | |
| // Replace with your own Account ID | |
| accountId: 'da967f53ae524ff98464a39c43d3a8gg', | |
| plugin: { | |
| customDimension: { | |
| // Replace X with custom dimension index for Provided Keyword | |
| keyword: 'dimensionX', | |
| // Replace Y with custom dimension index for Provided Position | |
| position: 'dimensionY', | |
| // Replace Z with custom dimension index for Provided Search Engine | |
| database: 'dimensionZ', | |
| event: true | |
| } | |
| } | |
| }; | |
| var s = window.document.createElement('script'); | |
| s.type = 'text/javascript'; | |
| s.async = true; | |
| s.src = '//cdn.royapp.com/kp.js'; | |
| var x = window.document.getElementsByTagName('script')[0]; | |
| x.parentNode.insertBefore(s, x); | |
| }(window)); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment