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

Move the tracking setting to the general setting tab #978

Merged
merged 2 commits into from
Jul 8, 2024
Merged

Conversation

girishpanchal30
Copy link
Contributor

@girishpanchal30 girishpanchal30 commented Jul 5, 2024

I've moved the data tracking Global Settings field to the General Settings tab.

Close https://github.com/Codeinwp/tweet-old-post-pro/issues/512

@pirate-bot
Copy link
Contributor

pirate-bot commented Jul 5, 2024

Plugin build for 965dc51 is ready 🛎️!

Copy link
Contributor

@Soare-Robert-Daniel Soare-Robert-Daniel left a comment

Choose a reason for hiding this comment

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

I see that you removed the toggle_tracking function, and I do not know if you updated the option to enable/disable the tracking script 🤔 . Is there an equivalent of update_option( 'tweet_old_post_logger_flag', $tracking ? 'yes' : 'no' ); ?

If you are now integrating the value into dashboard flow, there should be some toggle for the tracking option linked to it when you save the values.

@girishpanchal30
Copy link
Contributor Author

@Soare-Robert-Daniel

I see that you removed the toggle_tracking function, and I do not know if you updated the option to enable/disable the tracking script

The toggle_tracking function is used to save the enable/disable on the change event and now it will be saved when the user clicks on the save button so I've removed it.

Is there an equivalent of update_option( 'tweet_old_post_logger_flag', $tracking ? 'yes' : 'no' ); ?

Previously it was used here

$rop_api_settings['tracking'] = 'yes' === get_option( 'tweet_old_post_logger_flag', 'no' );

when localized the settings data, I used it here when the tracking key was not found in general settings.

@Soare-Robert-Daniel
Copy link
Contributor

@girishpanchal30, I see what was your point.

Here is the missing context: the option 'tweet_old_post_logger_flag' controls the actual loading of the script from Themeisle SDK https://github.com/Codeinwp/themeisle-sdk/blob/b9ba5697b150eddacb4aa482b363d9f459f822c5/src/Modules/Logger.php#L117

You moved the value inside the rop_data, but the SDK does not use it.

You also have to update that option when you save the dashboard to actually make it work.

To test whether the script was loaded, check in the browser console if window.tiTrk and window.tiTelemetry are available (make sure to not have other products with tracking enabled)

@girishpanchal30
Copy link
Contributor Author

@Soare-Robert-Daniel Thank you for sharing the actual way to make it work properly.

Now I've also updated the tweet_old_post_logger_flag option when saving the dashboard settings, I tested it with the browser console and it seems working fine.

Thanks

@rodica-andronache
Copy link

@girishpanchal30 tested and it works well 👍

@selul selul merged commit 91464a0 into development Jul 8, 2024
5 of 6 checks passed
@pirate-bot
Copy link
Contributor

🎉 This PR is included in version 9.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Indicate that an issue has been resolved and released in a particular version of the product.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants