Commit
* the tests/js is now passing following Benaka's commit, sweeet * Adding setsiteId to the "special case" so that setSiteId can be called after trackpageView and it still works * Adding pathname in the generated JS * HTML entity the & in the IMG src
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<!-- Piwik --> | ||
<script type="text/javascript"> | ||
var _paq = _paq || []; | ||
_paq.push(['setSiteId', {$idSite}]); | ||
_paq.push(['trackPageView']); | ||
_paq.push(['enableLinkTracking']); | ||
(function() { | ||
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://{$piwikUrl}/"; | ||
_paq.push(['setTrackerUrl', u+'piwik.php']); | ||
_paq.push(['setSiteId', {$idSite}]); | ||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; | ||
g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); | ||
})(); | ||
</script> | ||
<noscript><p><img src="http://{$piwikUrl}piwik.php?idsite={$idSite}" style="border:0" alt="" /></p></noscript> | ||
<!-- End Piwik Code --> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -480,7 +480,7 @@ | |
'CoreAdminHome_JSTracking_MergeSubdomains' => 'Track visitors across all subdomains of', | ||
'CoreAdminHome_JSTracking_MergeSubdomainsDesc' => 'So visitors to %1$s will not be treated as new if they visit %2$s for the first time.', | ||
'CoreAdminHome_JSTracking_MergeAliases' => 'Track visitors across all alias URLs of', | ||
'CoreAdminHome_JSTracking_MergeAliasesDesc' => 'So visitors to the main URL will not be treated as new if they visit an alias URL for the first time.', | ||
'CoreAdminHome_JSTracking_MergeAliasesDesc' => 'So clicks on links to Alias URLs (eg. %s) will not be counted as "Outlink".', | ||
'CoreAdminHome_JSTracking_GroupPageTitlesByDomain' => 'Prepend the site domain to the page title when tracking', | ||
'CoreAdminHome_JSTracking_GroupPageTitlesByDomainDesc' => 'So if someone visits the \'About\' page on blog.example.com it will be recorded as \'blog / About\'. This is the easiest way to get an overview of your traffic by sub-domain.', | ||
'CoreAdminHome_JSTracking_VisitorCustomVars' => 'Track custom variables for this visitor', | ||
|
@@ -617,7 +617,7 @@ | |
'CoreHome_PeriodWeeks' => 'weeks', | ||
'CoreHome_PeriodMonths' => 'months', | ||
'CoreHome_PeriodYears' => 'years', | ||
'CoreHome_YearShort_js' => 'yr', | ||
'General_YearShort_js' => 'yr', | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sgiehl
Member
|
||
'CoreHome_DaySu_js' => 'Su', | ||
'CoreHome_DayMo_js' => 'Mo', | ||
'CoreHome_DayTu_js' => 'Tu', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,8 +174,7 @@ $(document).ready(function() { | |
// generate JS | ||
var result = '<!-- Piwik -->\n\ | ||
<script type="text/javascript">\n\ | ||
var _paq = _paq || [];\n\ | ||
_paq.push(["setSiteId", ' + JSON.stringify(idSite) + ']);\n'; | ||
var _paq = _paq || [];\n'; | ||
|
||
if (groupPageTitlesByDomain) | ||
{ | ||
|
@@ -231,6 +230,7 @@ $(document).ready(function() { | |
(function() {\n\ | ||
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://' + piwikHost + '/";\n\ | ||
_paq.push(["setTrackerUrl", u+"piwik.php"]);\n\ | ||
This comment has been minimized.
Sorry, something went wrong.
robocoder
Contributor
|
||
_paq.push(["setSiteId", ' + JSON.stringify(idSite) + ']);\n\ | ||
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";\n\ | ||
g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);\n\ | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mattab
Author
Member
|
||
})();\n\ | ||
|
@@ -245,7 +245,7 @@ $(document).ready(function() { | |
{ | ||
// get data ( (("https:" == document.location.protocol)?"https://' + piwikHost + '":"http://' + piwikHost + '") ) | ||
var idSite = $('#image-tracker-website .custom_select_main_link').attr('siteid'), | ||
piwikURL = "https:" == document.location.protocol ? "https://" + piwikHost : "http://" + piwikHost, | ||
piwikURL = ("https:" == document.location.protocol ? "https://" + piwikHost : "http://" + piwikHost) + document.location.pathname, | ||
actionName = $('#image-tracker-action-name').val(), | ||
idGoal = null, | ||
revenue = null; | ||
|
@@ -280,9 +280,10 @@ $(document).ready(function() { | |
} | ||
|
||
var result = '<!-- Piwik Image Tracker -->\n\ | ||
<img src="' + piwikURL + '/?' + $.param(params) + '" style="border:0" alt="" />\n\ | ||
<img src="' + piwikURL + '?' + $.param(params) + '" style="border:0" alt="" />\n\ | ||
<!-- End Piwik -->'; | ||
|
||
|
||
result = result.replace("&", "&", "g"); | ||
$('#image-tracking-link textarea').val(result); | ||
}; | ||
|
||
|
2 comments
on commit c405a15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this is complete, please commit/push the minified /piwik.js.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, thanks for the reminder (done)
Was that change intentional? @sgiehl will have to update the translated files since tests are currently failing for some languages that still contain the CoreHome_YearShort_js entry.