• Resolved salomancho

    (@salomancho)


    Hi and thanks in advance,
    I have 5 badges set up to trigger when users visit a specific page. they are all setup like this:
    2023-01-09_21-54-17

    I tested with several users, but the batch is not triggering in the backend, and not showing on profiles, any ideas on what may be the problem?

    link to one of the pages that should trigger the badge

    Thanks again

    • This topic was modified 3 years, 4 months ago by salomancho.

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor Paco González Pérez

    (@pacogon)

    Hi @salomancho!

    I would be more than happy to assist you today.

    When you created the event “Daily visti a specific post” did you press the “Save All Steps” button? When you add events to achievements, ranks or points you must press the “Save All Steps” button to save those events.

    If you look at the screenshot you sent me there is an exclamation mark in an orange circle, that means that the event you have added to your achievement has not been saved.

    Try this and let me know.

    Hope it helps!

    Thread Starter salomancho

    (@salomancho)

    the problem was I was using the badge link itself instead of the page. I resolved it by converting the pages to posts and selecting them. but still, two problems remain.

    1) triggered badges I see in the backend are not showing in front end user profiles badges section

    2) it will be better for me if I can use pages for this, as I have more freedom to design these pages as I like, is there any way to do this for pages instead of posts?

    thanks again!

    Plugin Contributor Paco González Pérez

    (@pacogon)

    Hi @salomancho!
    1- Do you use BuddyBoss? To display the badges earned on user profiles you will have to use a plugin like BuddyBoss or BuddyPress that allows you to display these badges on the user’s profile. Otherwise to display user badges on pages or posts you can use “Achievements” blocks, shortcodes or widgets that allow you to display the achievements obtained by the user. Blocks https://gamipress.com/docs/blocks/achievements/ Shortcodes https://gamipress.com/docs/shortcodes/gamipress_achievements/ Widgets https://gamipress.com/docs/widgets/achievements/
    2-The “Daily Visit a post” event works with both pages and posts. You can create a page and award an achievement when it is visited with the event “Daily visit to a specific post”. This event allows you to select pages as well, for example: a- You create a page called “My page”. b- You create an achievement called VISIT with the event “Daily visit a specific post=My page”. c- When the user visits “My page”, he will be rewarded with the achievement VISIT.

    Thread Starter salomancho

    (@salomancho)

    hi, thanks again I did try before bu it was not showing any pages in the selector only posts…

    Thread Starter salomancho

    (@salomancho)

    I tried adding like this but doesn’t look like it works

    2023-01-10_16-10-22

    Thread Starter salomancho

    (@salomancho)

    ok after digging further I found out what is the problem, when I go to the badge itself and I click the link I get awarded that badge, problem is that when the user fill out the questionnaire it doesn’t trigger:

    https://community.anxietysocialnet.com/social-anxiety-self-assessment-test/

    at the ned of the questionnaire they re redirected via javascript:

    // Use a series of if-else statements to redirect to a different page based on the score range
    if (avgScore === 0) {
    window.location.assign(“/zero-symptoms/”);
    } else if (avgScore > 0 && avgScore <= 1) {
    window.location.assign(“/mild-symptoms/”);
    } else if (avgScore > 1 && avgScore <= 2) {

    I am guessing this is not supported, is there any way to make it trigger?

    thanks again!

    (i am using social iv theme, the other issue is sorted already)

    Plugin Contributor Paco González Pérez

    (@pacogon)

    Hi @salomancho.

    It’s pretty weird, I just did a test on my WordPress and it shows me all the pages.
    I just made a video for you showing that it works. https://www.loom.com/share/e65b4a2f01cc4a508cc6acc900433d36

    If it doesn’t work it is possible that you have installed a plugin or theme that is conflicting with GamiPress and its add-ons, in this case I recommend that you run a conflict test.
    There is an explanation on how to do it: https://gamipress.com/docs/troubleshooting/theme-and-plugins-conflict-test/
    The conflict test is really simple, the only thing you need is to switch to a default WordPress theme (to check that the conflict is not coming from your theme):
    https://codex.ww.wp.xz.cn/WordPress_Default_Themes

    And deactivate the plugins one by one to find the one that is causing this problem.

    Try it and keep me informed.

    Thread Starter salomancho

    (@salomancho)

    I think I confused you, I do see the pages on the backend. let me try to clarify with bullets:

    1) I created a custom quiz and added the code in element.
    2) there are 5 different results and for each result, there is a page.
    3) when the javascript calculates the score it redirects to the trigger page, but instead of the user clicking the actual link it uses “window.location.assign(“/zero-symptoms/”);”
    4) when you physically click on the link, the badge gets awarded. but this javascript does not do it.

    any other idea on how I can set this up so it work with gamipress, the questionnaire need custom java for the score calculation, so mus quizzes plugins will not do the trick.

    Thanks again for all the support, it is apreciated!

    Plugin Contributor Paco González Pérez

    (@pacogon)

    Hi @salomancho !
    In this case, as you have a custom development you will have to see a developer to change the code so that when redirecting you get a real visit to the page.

    Thread Starter salomancho

    (@salomancho)

    hey paco, I resolved this by having the page reload via javascript when users visit from the questionnaire. it works. I wanted to share this in case somebody else looking for this:

    here is the code to place on the page you want to trigger:

    let urlHistory = window.history;
    if(urlHistory === “https://community.anxietysocialnet.com/social-anxiety-self-assessment-test/&#8221;){
    location.reload();
    }

    thanks for the support!

    Plugin Contributor Paco González Pérez

    (@pacogon)

    Hi @salomancho.
    Glad to hear you got it up and running.
    Thank you very much for sharing your solution in the forum, this can be very useful for the rest of the users.
    We appreciate it very much.
    🙂

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘badges (specific page) not triggering’ is closed to new replies.