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

[HOMEPAGE] AB test fréquentation de la page documentation #499

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion lacommunaute/templates/pages/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,18 @@ <h2 class="h1 mb-3 mb-lg-5">
<span class="ms-2">Progressez grâce à des ressources exclusives</span>
</li>
</ul>
{% include "partials/ask_a_question.html" %}
</div>
<div class="s-hero-title-01__col col-12 d-none d-lg-inline-flex col-md-4">
<div>
<img src="{% static 'images/hp-illustration-01.svg' %}" class="img-fluid w-lg-75" loading="lazy" alt="">
</div>
</div>
</div>
<div class="s-hero-title-01__row row align-items-center">
<div class="s-hero-title-01__col s-hero-title-01__col--title col-12 mt-3 mt-lg-5">
{% include "partials/ask_a_question.html" %}
</div>
</div>
</div>
</section>
<section class="s-section mt-0">
Expand Down Expand Up @@ -202,4 +206,39 @@ <h3 class="m-0">
setTimeout(displayTallyPopup, delayBeforeShowingPopupInSeconds * 1000);
};
</script>
<!-- Matomo A/B Test -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['AbTesting::create', {
name: 'first_dummy_test', // you can also use '2' (ID of the experiment) to hide the name
percentage: 100,
includedTargets: [{
"attribute": "url",
"inverted": "0",
"type": "equals_simple",
"value": "https:\/\/communaute.inclusion.beta.gouv.fr\/"
}],
excludedTargets: [],
variations: [{
name: 'original',
activate: function(event) {
// usually nothing needs to be done here
}
}, {
name: 'bouton_plein', // you can also use '2' (ID of the variation) to hide the name
activate: function(event) {
event.redirect('https://communaute.inclusion.beta.gouv.fr/?btn=pl');
}
}, {
name: 'bouton_outlined', // you can also use '3' (ID of the variation) to hide the name
activate: function(event) {
event.redirect('https://communaute.inclusion.beta.gouv.fr/?btn=outl');
}
}],
trigger: function() {
return true; // here you can further customize which of your visitors will participate in this experiment
}
}]);
</script>
<!-- Matomo A/B Test -->
{% endblock %}
15 changes: 15 additions & 0 deletions lacommunaute/templates/partials/ask_a_question.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,20 @@
<span>{% trans "Search forums" %}</span>
</a>
</div>
{% comment %}AB Test - variation bouton documentation{% endcomment %}
{% if request.GET.btn %}
<div class="col-12 col-md-auto py-1 py-md-0 px-md-0 text-center">ou</div>
<div class="col-12 col-md-auto">
<a href="{% url 'forum_extension:documentation' %}"
class="btn {% if request.GET.btn == 'pl' %}btn-primary{% else %}btn-outline-primary{% endif %} btn-ico btn-block matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="documentation">
<span>Consulter la documentation</span>
</a>
</div>
{% comment %}END AB Test - variation bouton documentation{% endcomment %}
<div id="bouton_outlined" class="d-none">yyy</div>
{% endif %}
</div>
{% endif %}