I have a code snippet for implementing Google Analytics. Here it is:
$(function () {
$('.plan-choose-btn a').bind('click', function(e) {
//ga load image
<% String myaccGAEventUrl = trackGoogleAnalyticsEvent(request, "MO-22651379-1", "calltoaction", "buy", "PLC_HOLDER"); %>
var action = '<%=myaccGAEventUrl%>';
var hr = $(this).attr('href');
var bundle = hr.split("id=")[1].split("&")[0];
action = action.replace("PLC_HOLDER", bundle);
$('body').append('<img src="'+action+'" width="1" height="1" />');
});
});
When I test this on a desktop browser, the variable "action" is correctly updated with the appropriate value replacing the placeholder text. However, when viewing my Google Analytics dashboard on mobile, I notice that many event labels still show as "PLC_HOLDER".
Could it be possible that the .replace() function is not functioning correctly on mobile devices?