2

I have a pdf file named "ロケールストリングのキャッシュ最適化-v3-20160202_1047.pdf".

On using google tag manager to get the file name from the download URL, I get the value as "%E4%BE%9B%E7%B5%A6%E8%A8%88%E7%94%BB-v3-20160202_1047.pdf". I'm using javascript to fetch the file names in Google Tag Manager.

Is there a way in Javascript to make sure that the file name stays in the given language while the data is being sent to Google Analytics ?

Alok Nath Saha
  • 297
  • 1
  • 4
  • 20

1 Answers1

0

I got the solution. If we have the file name as "%E4%BE%9B%E7%B5%A6%E8%A8%88%E7%94%BB-v3-20160202_1047.pdf", we can get back the file name ("ロケールストリングのキャッシュ最適化-v3-20160202_1047.pdf") by using encodeURIComponent and decodeURIComponent in tandem.

    var encodeUri = encodeURIComponent(filename)
    filename = decodeURIComponent(encodeUri);
Alok Nath Saha
  • 297
  • 1
  • 4
  • 20