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

Getting error(dict_keys(['error'])) while using Python api #1085

Open
Sanchit-emeritus opened this issue Oct 23, 2024 · 0 comments
Open

Getting error(dict_keys(['error'])) while using Python api #1085

Sanchit-emeritus opened this issue Oct 23, 2024 · 0 comments

Comments

@Sanchit-emeritus
Copy link

Sanchit-emeritus commented Oct 23, 2024

Project Robyn

Describe issue

I am using Robyn api from Python and while running the below code after setting the arguments for hyperparameters it is giving dict_keys(['error'])
This is the code I am trying to run :

# Get response
InputCollect = robyn_api('robyn_inputs',payload=payload)
InputCollect.keys()

Please let me know how to resolve this error. It would be a great help. Thanks in advance.

Provide reproducible example

This is how i setup my input variables for robyn_inputs :

inputArgs = {
    "date_var": "date", # date format must be "2020-01-01"
    
    "dep_var": "total_paid_apps", # there should be only one dependent variable
    
    "dep_var_type": "conversion", # "revenue" (ROI) or "conversion" (CPA)
    
    "prophet_vars": ["trend", "season", "weekday", "holiday"], # "trend","season", "weekday" & "holiday"
    
    "prophet_country": "US", # input country code. Check: dt_prophet_holidays

    "context_vars" : ["mdr_dummy"],
   
    "paid_media_spends": ["total_spend_social", "total_spend_sem_brand", "total_spend_sem_nonbrand", "total_spend_linkedin", "total_spend_sem_others", "total_spend_other_paid"], # mandatory input
    
    # "paid_media_vars": ["total_impressions_social", "total_clicks_social", "total_leads_social", "total_apps_social", 
    #                     "total_impressions_sem_brand", "total_clicks_sem_brand",  "total_leads_sem_brand", "total_apps_sem_brand", 
    #                     "total_impressions_sem_nonbrand", "total_clicks_sem_nonbrand", "total_leads_sem_nonbrand", "total_apps_sem_nonbrand", 
    #                     "total_impressions_linkedin", "total_clicks_linkedin", "total_leads_linkedin", "total_apps_linkedin", 
    #                     "total_impressions_sem_others", "total_clicks_sem_others", "total_leads_sem_others", "total_apps_sem_others", 
    #                     "total_impressions_affiliate", "total_clicks_affiliate", "total_leads_affiliate", "total_apps_affiliate", 
    #                     "total_impressions_other_paid", "total_clicks_other_paid", "total_leads_other_paid", "total_apps_other_paid"], # mandatory.

    "paid_media_vars": ["total_clicks_social", "total_clicks_sem_brand", "total_clicks_sem_nonbrand", "total_clicks_linkedin", "total_clicks_sem_others", "total_clicks_other_paid"], 

    # paid_media_vars must have same order as paid_media_spends. Use media exposure metrics like
    # impressions, GRP etc. If not applicable, use spend instead.
    
    # "organic_vars" : ["total_leads_referral", "total_apps_referral", 
    #                   "total_leads_organic", "total_apps_organic"],  # marketing activity without media spend
    
    "factor_vars" : ["mdr_dummy"], # force variables in context_vars or organic_vars to be categorical
    
    "window_start": "2021-12-09",
    
    "window_end": "2024-08-28",
    
    "adstock": "weibull_pdf" # geometric, weibull_cdf or weibull_pdf.
}

Also wanted to ask If i want to provide impressions, clicks, leads, etc in paid_media_vars for each marketing channel defined in paid_media_spend, how can i do it? As of now I am using only one variable for each marketing spend, i.e. number of clicks. But if you see the commented paid_media_vars in my code above, there I have tried to put multiple variables like impressions, clicks, leads, etc. is it the correct way to pass multiple variables for each marketing channel in paid_media_vars ?

Environment & Robyn version

Using ['3.11.1.9003'] version of Robyn

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

No branches or pull requests

1 participant