Webtrekk Plugins

Silver Contributor
Silver Contributor

Hello,

 

I have a question about, how to activate Webtrekk plugins in Tealium iQ.

 

I've added the plugins (javascript code) as an extension and set it as preloader.

To activate the plugin in the tag, i created a "set data value" with the  parameters "wt_pageLoadTime; wt_cdb" and mapped it the Webtrekk tag to "wt_config.executePluginFunction" to activate the plugins in Webtrekk.

 

But it is not working. Did I miss something? 

5 REPLIES 5

Webtrekk Plugins

Employee Emeritus

Hello @davidlackovic. It sounds like you've already seen https://community.tealiumiq.com/t5/Tags/Webtrekk-Tag-Basic-Configuration-and-Data-Mappings/ta-p/1408....

 

Let me see if I can find you some help. Sit tight. 

Remember to give me a kudo if you like my post! Accepting my post as a solution is even better! Also remember that search is your friend.

Webtrekk Plugins

Silver Contributor
Silver Contributor

thank you Kathleen!

 

Yes, I read that article.

I saw that there is a "executePluginFuntion" function, which I need to activate the plugins, inside the Webtrekk tag.

But somehow it's not working :/

Webtrekk Plugins

Silver Contributor
Silver Contributor

Hi kathleen,

 

this is the configuration, perhaps it's helpful to finding a solution to the problem.

 

1. Plugin JavaScript Code as Preloader

http://will-man.de/screens/Extension-WTPageLoadPlugin.JPG

 

2. Extension to activate the Plugins in the Webtrekk tag.

http://will-man.de/screens/Extension-SetExecution.JPG

 

3. Mapping in the tag

http://will-man.de/screens/Tag-DataMapping.JPG

 

 

thanks in advance

Webtrekk Plugins

Silver Contributor
Silver Contributor

 

The problem with the Pageload-Time Plugin was this line in the original script (line 17)

 

 

wt_plt.sendinfo(false, false, "heatmap", false);

which overwrites parameters.

 

 

 

# changes to the script

 

To get this to work you need to pass the data sources at the window level. This is the adjusted  code for lin 6-19.

  

 

  this.sendPageLoadTime = function() {
            var wt_lt = wt_plt.performance.timing.loadEventStart - wt_plt.performance.timing.fetchStart;
            if (wt_lt && wt_lt !== null && wt_lt > 0) {
                // pass the data sources at window level
                if (!window.wt_pixelConfig.customParameter) {
                    window.wt_pixelConfig.customParameter = {};
                };
                // pass the page laod time at window level
                window.wt_pixelConfig.customParameter[570] = "" + wt_lt;
            };
// old line
// wt_plt.sendinfo(false, false, "heatmap", false);
// now send Webtrekk pixelconfig wt_plt.sendinfo(window.wt_pixelConfig);

 

 

 

 

# changes to the Webtrekk Tag

 

Look for this code snippet:

 

        // call sendinfo with custom arguments for one or more pixel request
        // from potentially the same page
        if (window[u.data.wt_object_name].sendinfo) {
          window[u.data.wt_object_name].sendinfo(u.data.pixelConfig);

          // update globalConfig contentId with any view/link request sent from the same page
          if (u.data.pixelConfig.contentId !== undefined) {
            window[u.data.wt_object_name].contentId = u.data.pixelConfig.contentId;
          }
        }

 

and change it to this:

 

        // call sendinfo with custom arguments for one or more pixel request
        // from potentially the same page
        if (window[u.data.wt_object_name].sendinfo) {

         //EDIT - persist the pixelconfig to not be overwritten by plugins:
         window.wt_pixelConfig = u.data.pixelConfig;
         //END-EDIT

          window[u.data.wt_object_name].sendinfo(u.data.pixelConfig);

          // update globalConfig contentId with any view/link request sent from the same page
          if (u.data.pixelConfig.contentId !== undefined) {
            window[u.data.wt_object_name].contentId = u.data.pixelConfig.contentId;
          }
        }

 

Thanks to James Keith!

 

Webtrekk Plugins

Employee Emeritus

Thank you @davidlackovic for sharing your answer with us!

 

Great job @jameskeith on the assist.

Remember to give me a kudo if you like my post! Accepting my post as a solution is even better! Also remember that search is your friend.
Public