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

Fix title conversions #7

Merged
merged 5 commits into from
Nov 22, 2024
Merged

Fix title conversions #7

merged 5 commits into from
Nov 22, 2024

Conversation

dphiffer
Copy link
Contributor

@dphiffer dphiffer commented Nov 22, 2024

The status quo is that title tests are all messed—when they're configured to only convert on "homepage click" they are still getting conversion numbers added on pageload. This PR fixes the problem and cleans up some of the structures that made it hard to see the problem in the first place.

@dphiffer dphiffer requested a review from BatMiles November 22, 2024 16:15
}
}
return $variants;
return $tests;
Copy link
Member

Choose a reason for hiding this comment

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

these var names are so much clearer

@BatMiles
Copy link
Member

Trying to test locally (mostly for my own familiarity with the plugin) - when you say 'configured to only convert on 'homepage click'', does that mean the 'Conversion Criterion' is 'Click', with the target selector/content set to the article's title link on the homepage?

@dphiffer
Copy link
Contributor Author

Yeah exactly. You should be able to test this either from the plugin's docker setup, or from the website's. I think the latter is better from a "getting familiarized" standpoint. I'd pull down the most recent changes that add data-id to the homepage, and then:

cd wp/wp-content/plugins
rm -rf split-tests
git clone [email protected]:the-markup/split-tests.git
cd split-tests
git checkout fix-title-conversions
npm install
npm run build

And then just make sure the plugin is activated (via wp/conf/wp-config-local.php and wp/wp-content/mu-plugins/active-plugins.php).

Making the post title test would look like this:

  1. Pick an article to test, go to its editor
  2. Scroll down and add a title variant (save)
  3. Go to Split Tests and edit the associated split test (it gets created automatically)
  4. Edit so that it only runs on the homepage
  5. Change the conversion criterion to be "click" and a target selector like .article a[data-id="XXXX"] where the ID is the post's ID whose title is changing (not the split test post's ID).

@dphiffer dphiffer merged commit 0e8dcc5 into main Nov 22, 2024
@dphiffer dphiffer deleted the fix-title-conversions branch November 22, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants