Skip to content

Commit

Permalink
feat(forum): Activation de l'AB Test Notation des forums (#686)
Browse files Browse the repository at this point in the history
## Description

🎸 cf titre

## Type de changement

🚧 technique
  • Loading branch information
vincentporte authored Jun 18, 2024
1 parent 015e08b commit c5699d4
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions lacommunaute/templates/forum/forum_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,41 @@ <h1>{{ forum.name }}</h1>
</section>
{% endif %}
{% endblock content %}
{% block extra_js %}
<!-- Matomo A/B Test -->
<script nonce="{{ request.csp_nonce }}">
var _paq = _paq || [];
_paq.push(['AbTesting::create', {
name: 'RatingForum_Position', // you can also use '8' (ID of the experiment) to hide the name
percentage: 100,
includedTargets: [{"attribute":"url","inverted":"0","type":"any","value":""}],
excludedTargets: [],
startDateTime: '2024/06/18 00:00:00 UTC',
variations: [
{
name: 'original',
activate: function (event) {
// usually nothing needs to be done here
}
},
{
name: 'rating_area_2', // you can also use '13' (ID of the variation) to hide the name
activate: function(event) {
$("#rating_area2").removeClass("d-none")
$("#rating_area1").addClass("d-none")
}
}, {
name: 'rating_area_3', // you can also use '14' (ID of the variation) to hide the name
activate: function(event) {
$("#rating_area3").removeClass("d-none")
$("#rating_area1").addClass("d-none")
}
}
],
trigger: function () {
return true; // here you can further customize which of your visitors will participate in this experiment
}
}]);
</script>
<!-- Matomo A/B Test -->
{% endblock %}

0 comments on commit c5699d4

Please sign in to comment.