1

trying to load utag.js from static resource in lightning component with following tag.

      <ltng:require scripts="/resource/UTAG1/utag/utag.js" afterScriptsLoaded = "{!c.afterScriptsLoaded}" />

in afterScriptsLoaded calling utag.view method.

   var utag_data = {
        userGuid : "", // 
                   l1 : "", // 
                   l2 : "", // 
                   l3 : "", // 
                   l4 : "", // 
                   l5 : "", // 
                   l6 : "", // 
                   l7 : "", // 
                   l8 : "", // 
                   event : "", //
                   environment : "", //
                   user_id : usrid, 
    }
    console.log('utag_data---'+utag_data);

    try{
        utag.view(utag_data);
    }
    catch(err){
        console.log(err);
    }   

utag.view(utag_data);here ended up with utag is not defined error. Please do needful.

2
  • Where did you get utag.js and what are you trying to achieve with this library ? Feb 2, 2020 at 15:31
  • 1
    utag is a tealiumiq javascript library which is used to track few details from salesforce as part of omniture adobe analytics.
    – user78527
    Feb 3, 2020 at 4:32

1 Answer 1

0

I think the property is not shared with lightning component . This doc might be helpful : https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/security_share_code.htm .

1
  • Thanks for the response. I already referred this.As this is external javascript, I am not sure how to apply this to utag.js file. Do you have any idea how to apply this on external js files.
    – user78527
    Feb 3, 2020 at 4:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .