- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
09-03-2019 03:54 AM
We have a marketing campaign widget on home page and is dispayed to users if they fullfill some criteria.
So i have made an "javascript code extension" and have written following code to track once it appears to the users. Scope is: Adobe Analytics App Measurement Code.
if(jQuery('div.grid-stack-item.marketing-widget.ui-draggable.ui-resizable.ui-resizable-autohide.ui-resizable-disabled').is(':visible'))
{
s.pageName ="Home";
s.events="event33";
s.prop8=s.eVar8=window.location.host+window.location.pathname;
s.eVar11 = window.location.hostname.split(".")[0];
s.t();
}
So i am getting one page load call each time marketing campaign widget is shown to user.
Also i am getting one more page load call from Adobe Analytics App Measurement TAG on every page.
So the ASK is if user see "marketing campaign widget" then both the page load call should be merged otherwise default call from Adobe Analytics App Measurement TAG should fire on Home Page.
Let me know the solution to handle this case.
Thanks.
Solved! Go to Solution.
09-03-2019 10:11 AM
Hi @parth_gupta199 ,
Great question. Here is my recommendation. Remove the s.t() function from the marketing campaign widget code and see if it works. This would prevent triggering an individual analytics call for the widget. As you are setting the eVar variables for widget, that should be automatically populated on the App Measurement tag when triggered.
My assumption is, whether the widget is visible or not is known before the Adobe Analytics App Measurement TAG is fired.
Hope this works. If not just let me know. We may need to find custom solutions based on the order of execution.
Thanks
Abraham
09-04-2019 12:53 AM
Thanks for the quick reply.
But removing s.t() from marketing campaign widget does not solve the problem. Not able to see both the calls getting merged. Scope for Marketing campaign widget is Adobe App Measurement only.
We have same evar and prop for both the calls, the only difference is in marketing campaign we are populating an extra event33.
09-04-2019 02:21 AM
09-04-2019 02:49 PM - edited 09-04-2019 02:49 PM
You are very welcome @parth_gupta199. Good to know the additional context about this requirement.
jayap3, Totally that the same thought i had in my mind.
@parth_gupta199 Here is another approach to test out. In order for the event33 to be added to the app measurement tag, i would recommend using a event data layer variable and then map that variable to event33 within the Adobe Analytics App Measurement TAG. Please find below some examples.
Extension should be updated as below:
if(jQuery('div.grid-stack-item.marketing-widget.ui-draggable.ui-resizable.ui-resizable-autohide.ui-resizable-disabled').is(':visible'))
{
b.event_type = "campaign_widget_shown";
}
Data layer: event_type
Data layer mapping within AppMeasurement tag
Below mapping informs Tealium IQ to send event33 when event_type data layer value is populated with value as "campaign_widget_shown".
All the values, data layer variable names given above are just created for this example. Feel free to change the names to the ones that best suits the need.
Let me know if this helps.
Thanks
Abraham
09-05-2019 08:28 AM
Copyright All Rights Reserved © 2008-2023