Announcement

Collapse
No announcement yet.

problems setting up fb and twitter analytics SDK codes using template hooks

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • problems setting up fb and twitter analytics SDK codes using template hooks

    following the very informative tutorial by Wayne on template hooks , as shown on

    https://www.vbulletin.com/forum/blog...-luke/3929999-

    we attempted the same for setting up 2 style template hooks for each , facebook analytics code and the other for Twitter analytics code .

    for example the facebook analytics code is shown here

    https://developers.facebook.com/docs...start-list/web

    of course beforehand we have already activated our vbulletin 5 with both twitter and fb , and we were given API KEYS and all and our third party login with twitter and fb are both up and running

    only that for some reason its been 24 hours now and still neither Fb nor twitter analytics codes took any effect, as if fb and twitter can't pick up from them , which means more or less that putting those codes on a style template then activating them with the template hook system does not work ?

    because of course neither fb or twitter mentions about template hooks , they simply instruct to put the codes directly on the page html in specific area's, which of course we followed BUT with substituting that by using the template hook system .

    seems not to work at all , seems to work in sense that neither fb nor twitter analytics recognize their existence at all , not that there is an error , its simply looks like not found or seen by twitter and fb analytics , any advice Wayne ?

    we appreciate your assistance

    thanks

  • #2
    Don't really have any advice... Don't have enough information to know what the problem is.

    What hooks are you using?
    What is the template hook set up for each one?
    Does the code appear in the outputted source for your style?
    What errors exist in your browser's console?

    If you allow users to select from multiple styles, you also need to add the template for the hook to each individual style.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud customization and demonstration site.
    vBulletin 5 Documentation - Updated every Friday. Report issues here.
    vBulletin 5 API - Full / Mobile
    I am not currently available for vB Messenger Chats.

    Comment


    • #3
      following word for word your post

      https://www.vbulletin.com/forum/blog...-luke/3929999-

      we have only one available style for all users

      we have even noticed the same problem with google analytics tracking code , but that was easier to solve cz it can be placed on a header banner slot, cz google just require it to be anywhere in the header html
      but in the case of twitter and fb analytics tracking codes since they require a more specific location so we used style template hooks with same settings in your tutorial , but it could never be detected by twitter nor fb

      Comment


      • #4
        Well that is a very specific implementation and puts code in a place in the footer that would be inappropriate for your current application. That is why I asked what your settings were for each template hook.

        For Google Analytics, why not just place the code in the box provided under Settings -> Options -> Search Engine Tools. In fact, you can probably place your Twitter and Facebook Analytics code in the exact same box.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud customization and demonstration site.
        vBulletin 5 Documentation - Updated every Friday. Report issues here.
        vBulletin 5 API - Full / Mobile
        I am not currently available for vB Messenger Chats.

        Comment


        • #5
          we followed your tutorial word for word except when it comes to the hook location settings , so since fb requires that SDK tracking code to be after_body_start , that's the hook location we chose , likewise with twitter it requires the location to be footer_before_body_end , i.e before the </body> tag in the page footer , and that was the location we exactly picked in the hook settings , important to note that those locations are already there in hook location choices in VB 5 , which tells us that some vBulletin geek in your development team knows exactly what he or she is doing , it may be even sepcifically made available for similar needs such as fb and twitter app sdk tracking codes , so check , u guys know about a similar use to that , downdownside is , for somereason both fb and twitter cant see it

          all other settings are default and from your tutorial above mentioned , and we have one single style for all , no choices to change it at all

          but u mentioned that we should check if the code rendered in the template html ? so u mean it should be seen in chrome inspect tool ? or is there any other way of confirming that ?

          worth mentioning this topic is not about the basic analytics code , its the tracking code offered to those who want more comprehensive details on the site performance , google offers one ,and thats the one we meant earlier in this post (not the initial google analytics code used to activate your account with them )

          earlier in this post we gave you the link to that of FACEBOOK as an example , even google and twitter has a similar one , that of google worked for us as a header ad slot , but we must use hooks for the code of twitter and FB cz they require a more specific location which we cant access except through changing the templates - of course bad idea - so we use the hook system u shared in the above mentioned post

          for you to get a better picture pls check the Facebook link we provided in the starting of this topic "this code is different than that of google analytics registration code ", also google and twitter has a similar one like that of FACEBOOK, so we provided the link to that of FACEBOOK as an example , but both twitter and google has something similar

          Comment


          • #6
            Hook locations are based on customer requests. We place them where they are requested.

            Looking at your page source, I can see both the Facebook and Twitter code in the page. The code is there. This means the Template Hook system is working.

            Looking in the Console and Network tabs for my browser's developer tools, I see a number of errors with your Javascript. Googletags and the Twitter tracking code fail to load. There is no error or response. Facebook's analytic code fails to load with this error: sdk.js:111 Uncaught a {message: "You need to call FB.init() with App ID first.", innerError: undefined}

            There are also other errors from your Custom Javascript. You will need to debug and troubleshoot these errors. As I stated above, vBulletin is working properly and inserting the template hooks. Unfortunately, Google Chrome can't execute the custom code provided without error.

            This may help you with Chrome's Developer Tools: https://developers.google.com/web/to...rome-devtools/

            You will need them to troubleshoot your issues.
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud customization and demonstration site.
            vBulletin 5 Documentation - Updated every Friday. Report issues here.
            vBulletin 5 API - Full / Mobile
            I am not currently available for vB Messenger Chats.

            Comment

            Related Topics

            Collapse

            Working...
            X