How to track successful file uploads or file imports.

Ankitajaiswal
Rookie Contributor
Ankitajaiswal

Capture.JPG

 

I would like to capture the successfully uploaded files on my website. 

2 REPLIES 2

How to track successful file uploads or file imports.

Tealium Employee

Hi @Ankitajaiswal ,

You will need to add a new listener to the html element for the drop event.

I would suggest following this approach https://community.tealiumiq.com/t5/Tealium-iQ-Tag-Management/Is-it-possible-to-track-drag-n-drop-wit...

 

Highlighted

How to track successful file uploads or file imports.

Tealium Employee

Hi @Ankitajaiswal 

If you use jQuery on your site, you could take advantage of the ajaxComplete event to send tracking as a callback.

jQuery(document).on('ajaxComplete', function(event, state, uri) {
  var url = uri.url;
  if (state.readyState == "4" && url.indexOf("your/endpoint") > -1) {
    utag.link({
      "event_category": "file_upload",
      "event_label": "profile_image",
      "event_value": "file.js"
    });
  }
});

Something along these lines will send a link event each time a file_upload ajax request is detected.

Hope that helps