FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » drupal php google analytics
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: drupal php google analytics [message #171006 is a reply to message #171005] Tue, 14 December 2010 21:30 Go to previous messageGo to previous message
Magno is currently offline  Magno
Messages: 49
Registered: October 2010
Karma:
Member
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?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: anyone?
Next Topic: require*/include*: compile-time or runtime?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Sep 19 01:25:32 GMT 2024

Total time taken to generate the page: 0.05000 seconds