New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignored setPageType() in JS tracker #366

Open
davidebaldini opened this Issue Sep 21, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@davidebaldini

davidebaldini commented Sep 21, 2018

OWA is configured and works overall, but the JS function setPageType() of the following script has no effect.

The script is inserted in the HTML head, and works overall, except for setPageType().

OWA version: 1.6.2.

<!-- Start Open Web Analytics Tracker -->
<script type="text/javascript">
//<![CDATA[
var owa_baseUrl = 'https://example.com/analytics/';
var owa_cmds = owa_cmds || [];
owa_cmds.push(['setSiteId', '78901235678901234567899012345678']);  // fictitious
owa_cmds.push(['trackPageView']);
owa_cmds.push(['trackClicks']);

(function() {
	var _owa = document.createElement('script'); _owa.type = 'text/javascript'; _owa.async = true;

	_owa.onload = function() {
		window.OWATracker.setPageType('forum');
		window.alert("loaded");
	}

	owa_baseUrl = ('https:' == document.location.protocol ? window.owa_baseSecUrl || owa_baseUrl.replace(/http:/, 'https:') : owa_baseUrl );
	_owa.src = owa_baseUrl + 'modules/base/js/owa.tracker-combined-min.js';
	var _owa_s = document.getElementsByTagName('script')[0]; _owa_s.parentNode.insertBefore(_owa, _owa_s);
}());
//]]>
</script>
<!-- End Open Web Analytics Code -->
@padams

This comment has been minimized.

Show comment
Hide comment
@padams

padams Sep 21, 2018

Owner
Owner

padams commented Sep 21, 2018

@davidebaldini

This comment has been minimized.

Show comment
Hide comment
@davidebaldini

davidebaldini Sep 22, 2018

I also tried to push the command like this, but it didn't work either:

var owa_baseUrl = 'https://example.com/analytics/';
var owa_cmds = owa_cmds || [];
owa_cmds.push(['setSiteId', '78901235678901234567899012345678']);  // fictitious
owa_cmds.push(['setPageType', 'forum']);
owa_cmds.push(['trackPageView']);
owa_cmds.push(['trackClicks']);

I'm using OWA 1.6.2 release, not the head.

davidebaldini commented Sep 22, 2018

I also tried to push the command like this, but it didn't work either:

var owa_baseUrl = 'https://example.com/analytics/';
var owa_cmds = owa_cmds || [];
owa_cmds.push(['setSiteId', '78901235678901234567899012345678']);  // fictitious
owa_cmds.push(['setPageType', 'forum']);
owa_cmds.push(['trackPageView']);
owa_cmds.push(['trackClicks']);

I'm using OWA 1.6.2 release, not the head.

@padams

This comment has been minimized.

Show comment
Hide comment
@padams

padams Sep 22, 2018

Owner
Owner

padams commented Sep 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment