Skip to content
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

JS Tracker: new setCrossDomainLinkingTimeout function useful to set a higher timeout for links #11828

Merged
merged 8 commits into from Jul 18, 2017

Conversation

mattab
Copy link
Member

@mattab mattab commented Jun 29, 2017

and increasing the default to 120 seconds

… higher timeout for links

and increasing the default to 120 seconds
@mattab mattab added the Needs Review PRs that need a code review label Jun 29, 2017
@mattab mattab added this to the 3.0.5 milestone Jun 29, 2017
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess we need to update the documentation as well and mention that new method?

js/piwik.js Outdated

if (timeoutInSeconds <= 0) {
return true;
}
if (currentTimestampInSeconds >= timestampInUrl
&& currentTimestampInSeconds <= (timestampInUrl + timeoutInSeconds)) {
// we only use visitorId if it was generated max 45 seconds ago
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment is outdated, as it's not 45 seconds, but configVisitorIdUrlParameterTimeoutInSeconds instead

js/piwik.js Outdated
@@ -3089,6 +3089,9 @@ if (typeof window.Piwik !== 'object') {
// VDI = visitor device identifier
configVisitorIdUrlParameter = 'pk_vid',

// Cross domain linking, the visitor ID is transmitted only in the 180 seconds following the click.
configVisitorIdUrlParameterTimeoutInSeconds = 120,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment says it's 180 seconds, but value actually is 120?

@sgiehl
Copy link
Member

sgiehl commented Jul 17, 2017

Code looks ok now. Let's wait for the tests to pass...

@sgiehl
Copy link
Member

sgiehl commented Jul 17, 2017

@mattab Seems some more changes are required here. See https://travis-ci.org/piwik/piwik/jobs/254631350#L498-L550

@@ -2872,12 +2873,13 @@ function makeReplaceHrefForCrossDomainLink(url) {
strictEqual(tracker.getTrackerUrl(), makeReplaceHrefForCrossDomainLink(tracker.getTrackerUrl()), 'replaceHrefForCrossDomainLink, should not change URL if href is a tracker URL');

tracker.setUserId('test');
debugger;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattab Any reason for adding this?

@sgiehl sgiehl merged commit 4576d92 into 3.x-dev Jul 18, 2017
@sgiehl sgiehl deleted the setCrossDomainLinkingTimeout branch July 18, 2017 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants