Quantcast
Channel: Support & Bugs - Matomo forums
Viewing all articles
Browse latest Browse all 5706

Camapign parameters are getting ignored

$
0
0

@pppez80 wrote:

Support group,

I am setting campaign values per javascript API prior to a trackPageView call; I validated that all properties are properly set but the campaign informaiton seems to get ignored both in the request and in the reports online.

Anything wrong with the below code that would give an exaplanation? I am setting custom values for URL and DocumentTitle (variables are being defined prior).

I am running 2.17.0.

var u="https://piwik.xxx.com/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '6']);
paq.push(['setCustomUrl', '<TMPLVAR name=url>']);
paq.push(['setDocumentTitle', '<TMPLVAR name=contentSlug>']);
var campaign = getParameterByName('pk_campaign');

var secondaryTracker = 'https://piwik.socapro.com/piwik.php';
var secondaryWebsiteId = <TMPL_VAR name=secondary>;
_paq.push(['addTracker', secondaryTracker, secondaryWebsiteId]);

if (campaign) {
_paq.push(['setCampaignNameKey', campaign]);
_paq.push(['setCampaignKeywordKey', 'anything']);
console.log(campaign);
}
_paq.push(['trackPageView']);

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5706

Trending Articles