0

Google アナリティクスでピンタレスト ボタンを追跡する必要があります。最初のコードは、pin div にラップされた pinterest ボタン コードの後に​​実装された html Web サイトで機能します。ソーシャル メディア ボタンの配列の一部である、以下の 2 番目のコードに適用しようとしています。しかし、それを機能させることはできません。どんな助けでも大歓迎です。私は自分の電話にいます。後で完全なコードを投稿します。これを捨てたかっただけです。

    <div class="pin"><a href="http://pinterest.com/pin/create/button/?url=http://www.myurl.com/testingjava.html" class="pin-it-button">Pin It</a></div>

        <script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script>
        <script>
        $(document).ready(function() {
                $('div.pin').click(function() {
                     _gaq.push(['_trackSocial', 'Pinterest', 'pin', $(location).attr('href')]);
                });
        });
        </script>



    'script' => '
    <div class="pin"><a href="http://pinterest.com/pin/create/button/?url=###URL###"        class="pin-it-button" count-layout="###layout###">Pin It</a></div>

    <script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js">           </script>
    <script type="text/javascript"> 
     $(document).ready(function() {
        $(\'div.pin\').click(function() {
            _gaq.push([\'_trackSocial\', \'Pinterest\', \'pin\', $(location).attr(\'href\')]);
            });
    }); 
    </script>',
4

2 に答える 2

1

スクリプトの開始タグが閉じていません:

 <script type="text/javascript">
 $(document).ready(function() {
    $(\'div.pin\').click(function() {
        _gaq.push([\'_trackSocial\', \'Pinterest\', \'pin\', $(location).attr(\'href\')]);
        });
}); 
</script>',
于 2013-07-22T18:06:16.507 に答える
0

I wrote a tutorial or at least an explination on how I tracked Pinterest, Google+, Facebook, and Twitter on an old HTML page using Google Analytics, I've used the same basic techniques on my favourite quotation mashup and even on my current employer's latest campaign page.

Basically jQuery is used to add in the event, this isn't a technique, other people thought of it first, but getting all four to work together is more work, plus I did the proper structured metadata etc. etc.

于 2014-05-22T21:45:22.613 に答える