Title: Template Tag Inside Javascript?
Last modified: August 19, 2016

---

# Template Tag Inside Javascript?

 *  [nickbudden](https://wordpress.org/support/users/nickbudden/)
 * (@nickbudden)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/template-tag-inside-javascript/)
 * Hi,
 * I’m trying to put together some dynamic document downloading tracking for google
   analytics, which basically means I have to be able to get a custom field inserted
   inside the google analytics script, as follows:
 * `javascript: pageTracker._trackPageview('/downloads/<?php the_title(); ?>');`
 * To make a long story short the php doesn’t seem to work inside the script…any
   ideas how I can make the script dynamic to include my page title?
 * Thanks for any help, and merry christmas!

The topic ‘Template Tag Inside Javascript?’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [nickbudden](https://wordpress.org/support/users/nickbudden/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/template-tag-inside-javascript/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
