Skip to content

Instantly share code, notes, and snippets.

@jsn789
Last active April 9, 2018 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsn789/1a3e4055640ddf68a9871ef5c86913e7 to your computer and use it in GitHub Desktop.
Save jsn789/1a3e4055640ddf68a9871ef5c86913e7 to your computer and use it in GitHub Desktop.
GTM Custom JavaScript - Cleans up downloaded PDF file name. Used for GA Events Label
function() {
// Example url: https://website.com/2015/10/File-Name.pdf
return {{Clicks - URL Path}}.split("/").slice(-1).join().split(".").shift();
// Returns: File-Name
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment