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

Add a new field custom URL Referrer on pageview tag #566

Open
wants to merge 8 commits into
base: 5.x-dev
Choose a base branch
from

Conversation

tomper00
Copy link
Contributor

@tomper00 tomper00 commented Nov 4, 2022

Description:

This is often needed when you work with SPA tracking since the Referrer often is not updated on virtual pageviews.
It is also nice to be able to create a custom JS Variable some times to be able to filter out PII etc.

Review

Being able to set a custom Url Referrer for pageviews is handy when you are working with SPA tracking.
It can also be handy of referrers contain PII data to be able to clan these values before they are posted to Matomo.
Adding new setting for urlRef + tests + en translation
@tomper00 tomper00 changed the title Add a new field custom URL Referrer on page tag Add a new field custom URL Referrer on pageview tag Nov 4, 2022
Copy link
Contributor

@snake14 snake14 left a comment

Choose a reason for hiding this comment

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

Thank you for taking the time to create this PR, @tomper00 . I think it looks really good. The only request I have is that you create a migration similar to the one you created in your other PR. I guess another option would be to wait until your other PR is merged, merge those changes into this branch, and then simply add a single $migrator->addField('customUrlRef'); line to the migration your created as part of your other PR.

Oh. One other side note. Please remember to add the Needs Review label to any PRs that you create in the future. It just makes it more visible to our team and lets us know that it's ready for us to provide feedback.

@tomper00
Copy link
Contributor Author

tomper00 commented Nov 7, 2022

Ok thanks again for the feedback @snake14 I will go with the option to merge my branches, that sounds like an easy way forward.

@snake14
Copy link
Contributor

snake14 commented Nov 7, 2022

Ok thanks again for the feedback @snake14 I will go with the option to merge my branches, that sounds like an easy way forward.

@tomper00 I just left a comment on your other PR, but I realised that I had you use the wrong class for the migration. Since this one is for a tag, you would use the NewTagParameterMigrator class. You can still merge your branches, but you'd need two lines instead of just the one:

$migrator = new NewTagParameterMigrator(MatomoTag::ID, 'customUrlRef');
$migrator->migrate();

So, if you merge the two branches, you would run NewTagParameterMigrator->migrate() for your tag column and NewVariableParameterMigrator->migrate() for your two variable columns.

lang/en.json Outdated Show resolved Hide resolved
tomper00 and others added 4 commits November 18, 2022 13:52
Translation updates based on comments from @AltamashShaikh

Co-authored-by: Altamash Shaikh <[email protected]>
Update test to match new translation
@tomper00 tomper00 requested a review from snake14 November 19, 2022 14:12
Copy link
Contributor

@snake14 snake14 left a comment

Choose a reason for hiding this comment

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

Looks good. I just left one comment.

$migrator = new NewTagParameterMigrator(MatomoTag::ID, 'customUrlRef');
$migrator->migrate();
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you merged the changes from your other branch into this one, you don't have to create a new migration script. You should be able to add the two lines from the doUpdate method in this one to the end of the doUpdate in the existing migration script. That way both your variable and tag changes get migrated in the same script. I guess it doesn't hurt to have two separate scripts, but it makes the release process a little more complicated.

Copy link
Contributor

Choose a reason for hiding this comment

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

@snake14 @tomper00 You should move this changes to 5.x-dev branch since the next release is 5.x-dev

@AltamashShaikh AltamashShaikh changed the base branch from 4.x-dev to 5.x-dev November 23, 2022 06:40
/**
* Update for version 4.12.4-b1.
*/
class Updates_4_12_4_b3 extends PiwikUpdates
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe that this will error out if the class name doesn't match the file name. Could you please update it?

Copy link
Contributor

Choose a reason for hiding this comment

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

@tomper00 would you please be able to update the class name to match the file name?

@AltamashShaikh
Copy link
Contributor

@tomper00 Any update on this ?

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

Successfully merging this pull request may close these issues.

3 participants