Re: drupal php google analytics [message #171010 is a reply to message #171008] |
Tue, 14 December 2010 22:39 |
Magno
Messages: 49 Registered: October 2010
Karma:
|
Member |
|
|
On 12/14/2010 07:05 PM, The Natural Philosopher wrote:
> Magno wrote:
>> On 12/14/2010 06:08 PM, Jerry Stuckle wrote:
>>> On 12/14/2010 2:25 PM, canajien wrote:
>>>> It has been a very long time since I have had to do any php
>>>> programming, so please bear with me as I haven't been able to find an
>>>> answer to this problem after several searches.
>>>>
>>>> There is a line of code in a drupal template that generates a link to
>>>> download a file:
>>>>
>>>> <?php print $node->field_report_file[0]['view'] ?>
>>>>
>>>> this will generate something like this
>>>>
>>>> <a href="filename.pdf">filename</a>
>>>>
>>>>
>>>> We are using google analytics with the website and we would like to
>>>> track how many times people download a file as well, normally to track
>>>> a link you would write the code to look like this:
>>>>
>>>> <a href="filename.pdf"
>>>> onclick="pageTracker._trackPageview('filename.pdf");">filename</a>
>>>>
>>>> my problem is modifyng the drupal code to include the onclick, I have
>>>> tried
>>>>
>>>> <?php print $node->field_report_file[0]['view'] print onclick=
>>>> \"pageTracker._trackPageview('$node->field_report_file[0]['view']\");?
>>>> >
>>>>
>>>>
>>>> and several variations, but I know there is something wrong with my
>>>> syntax and I can't simply insert print onclick=
>>>> \"pageTracker._trackPageview('$node->field_report_file[0]['view']\");
>>>> into the original command
>>>>
>>>> can someone point me in the write direction?
>>>>
>>>> thanks
>>>
>>> Try the Drupal site - they have a lot of people who are quite
>>> knowledgeable about drupal and can help you.
>>>
>>> TNP's suggestion is mediocre, at best. It fails if, for instance, people
>>> have javascript turned off - which includes robots which spider your
>>> site.
>>>
>>
>> I have always wondered why the troll keeps this much hatred against
>> TNP. And everytime he can, he calls him mediocre, clueless, and such
>> things.
>>
>> Anyone here knows?
>
>
> I showed him up on at least three occasions to not have a clue about
> that which he spouts. Quoting his beloved manuals that he studies at
> night back to him.
>
> Jerry doesn't like to be shown to be an ignorant pompous asshole. If you
> grovel at his feet, he will graciously feed him tidbits of wisdom.
>
> If you dare contest his ownership of the group, you are the spawn of the
> devil.
>
> It's a psychological condition he has. Right Man syndrome.
>
> He wants desperately to be a Guru, but he's not good enough so he *acts*
> like he is one, and hopes no one will come along who can see through him.
>
> Sadly I did.
>
> What pains him worse, is that I don't even want to be a guru. Its
> somehow makes his puny ambitions seem like..puny ambitions.
>
> I mean. look at the response above. The guy wants to know how to frame
> an onclick statement to call up some javascript in a drupal framwork.
>
> Jerry says 'no one would ever use javascript, and that's typical of TNP'
> But sadly the OP wanted to know how to use javascript.
>
> He has to change the subject and set up a straw man to recover his
> godlike status. In his own eyes.
>
> to anyone else, he just makes himself look like what he is. From time to
> time I goad him a little so everyone with any intelligence can see the
> asshole for what he is: the rest still think he wonderful, but then they
> deserve him.
>
> I killfiled him years ago.I never even as a PHP beginner found anything
> he said was not said better, more helpfully and more politely by someone
> else. In my lurking here, he has criticised everybodies code. I never
> saw him post a line of his own. He is I believe a one man IT training
> consultant. You can look up his company records and see how much he has
> earnt in the last few years. Its very sad.
I would have killfiled him too, but I don’t like beginners being
misguided by him or PointedEars.
Well, anyone can be a Guru if they want, but part of the learning
process is learning to be a respectful and clear person to communicate with.
Reading the answer he just put to this post, I clearly see your point now.
Greetings.
|
|
|